When a client re-registers with the model registry, its previous status for a given model (e.g., quota exceeded or suspended) was not being cleared. This could lead to a situation where a client is permanently unable to use a model even after re-registering. This change ensures that when a client re-registers an existing model, its ID is removed from the model's `QuotaExceededClients` and `SuspendedClients` lists. This effectively resets the client's status for that model, allowing for a fresh start upon reconnection.
Unified · Split
| @@ -237,6 +237,12 @@ func (r *ModelRegistry) RegisterClient(clientID, clientProvider string, models [ · 236 unmodified lines | ||
| 237 | 237 | if reg, ok := r.models[id]; ok { |
| 238 | 238 | reg.Info = cloneModelInfo(model) |
| 239 | 239 | reg.LastUpdated = now |
| 240 | + if reg.QuotaExceededClients != nil { | |
| 241 | + delete(reg.QuotaExceededClients, clientID) | |
| 242 | + } | |
| 243 | + if reg.SuspendedClients != nil { | |
| 244 | + delete(reg.SuspendedClients, clientID) | |
| 245 | + } | |
| 240 | 246 | if providerChanged && provider != "" { |
| 241 | 247 | if _, newlyAdded := addedSet[id]; newlyAdded { |
| 242 | 248 | continue |