feat: extend client affinity to all Anthropic account types

- Backend: expand IsClientAffinityEnabled() to support all Anthropic
  accounts (OAuth/SetupToken/APIKey), not just OAuth/SetupToken
- Frontend: show client affinity toggle for all Anthropic accounts
- Frontend: fix save logic to properly chain extra field updates
- Antigravity accounts explicitly excluded from client affinity

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erioandClaude Opus 4.6 committed 2026-03-06 17:44:27 +08:00
1 parent 5f4561306f
commit fb5f471fe1
2 files changed
+21 -9

No files matched your search

+2 -2
View File
@@ -1100,10 +1100,10 @@ func (a *Account) IsSessionIDMaskingEnabled() bool {
}
// IsClientAffinityEnabled 检查是否启用客户端亲和调度
// 适用于 Anthropic 和 Antigravity 账号
// 仅适用于 Anthropic 账号(OAuth/SetupToken/APIKey)
// 启用后,新会话会优先调度到之前使用过的账号
func (a *Account) IsClientAffinityEnabled() bool {
if a.Platform != PlatformAnthropic && a.Platform != PlatformAntigravity {
if a.Platform != PlatformAnthropic {
return false
}
if a.Extra == nil {