fix(phase-2): add thread-safety to ModelRegistry and Router reload operations

This commit is contained in:
newkirk
2026-07-21 13:20:29 -04:00
parent 42b70621a1
commit 4027ed4351
3 changed files with 29 additions and 4 deletions
+4 -1
View File
@@ -628,7 +628,10 @@ func (s *Server) handleChatCompletions(c *gin.Context) {
// Inject or cap max_tokens from model registry.
s.registryMu.RLock()
meta := s.registry.FindModel(modelID)
var meta *models.ModelMetadata
if s.registry != nil {
meta = s.registry.FindModel(modelID)
}
s.registryMu.RUnlock()
if meta != nil && meta.Limit != nil && meta.Limit.Output > 0 {