fix(thinking): fix auth matching for thinking suffix and json field conflicts

This commit is contained in:
hkfires
2026-01-14 09:02:26 +08:00
parent 0b06d637e7
commit e8f5888d8e
3 changed files with 15 additions and 0 deletions

View File

@@ -1711,6 +1711,13 @@ func (m *Manager) pickNext(ctx context.Context, provider, model string, opts cli
}
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.Provider != provider || candidate.Disabled {