fix(auth): use base model name for auth matching by stripping suffix

This commit is contained in:
hkfires
2026-01-15 10:18:22 +08:00
parent f6a2d072e6
commit 847be0e99d

View File

@@ -1743,6 +1743,13 @@ func (m *Manager) pickNextMixed(ctx context.Context, providers []string, model s
m.mu.RLock()
candidates := make([]*Auth, 0, len(m.auths))
modelKey := strings.TrimSpace(model)
// Always use base model name (without thinking suffix) for auth matching.
if modelKey != "" {
parsed := thinking.ParseSuffix(modelKey)
if parsed.ModelName != "" {
modelKey = strings.TrimSpace(parsed.ModelName)
}
}
registryRef := registry.GetGlobalRegistry()
for _, candidate := range m.auths {
if candidate == nil || candidate.Disabled {