From bb0043650913db06164c363df6958c5a8a0b9564 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Sat, 8 Nov 2025 18:19:34 +0800 Subject: [PATCH] fix(service): skip disabled auth entries during executor binding Prevent disabled auth entries from overriding active provider executors, addressing lingering configs during reloads (e.g., removed OpenAI-compat entries). --- sdk/cliproxy/service.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/cliproxy/service.go b/sdk/cliproxy/service.go index 27a40cc9..84d15ffe 100644 --- a/sdk/cliproxy/service.go +++ b/sdk/cliproxy/service.go @@ -305,6 +305,12 @@ func (s *Service) ensureExecutorsForAuth(a *coreauth.Auth) { if s == nil || a == nil { return } + // Skip disabled auth entries when (re)binding executors. + // Disabled auths can linger during config reloads (e.g., removed OpenAI-compat entries) + // and must not override active provider executors (such as iFlow OAuth accounts). + if a.Disabled { + return + } if compatProviderKey, _, isCompat := openAICompatInfoFromAuth(a); isCompat { if compatProviderKey == "" { compatProviderKey = strings.ToLower(strings.TrimSpace(a.Provider)) @@ -738,7 +744,7 @@ func (s *Service) resolveConfigClaudeKey(auth *coreauth.Auth) *config.ClaudeKey continue } if attrKey != "" && strings.EqualFold(cfgKey, attrKey) { - if attrBase == "" || cfgBase == "" || strings.EqualFold(cfgBase, attrBase) { + if cfgBase == "" || strings.EqualFold(cfgBase, attrBase) { return entry } }