mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-20 15:06:36 +00:00
fix: restrict client affinity to Anthropic OAuth/SetupToken accounts only
客户端亲和仅对 Claude Code 账号(Anthropic OAuth/SetupToken)生效, 移除 Antigravity 平台支持。UI toggle 移动到拦截预热请求下方。
This commit is contained in:
1 parent
c1816f39f2
commit
63dff62673
4 files changed
+39
-47
No files matched your search
@@ -250,7 +250,7 @@ func AccountFromServiceShallow(a *service.Account) *Account {
|
||||
}
|
||||
}
|
||||
|
||||
// 客户端亲和调度(适用于 Anthropic/Antigravity 平台)
|
||||
// 客户端亲和调度(仅 Anthropic OAuth/SetupToken 账号)
|
||||
if a.IsClientAffinityEnabled() {
|
||||
enabled := true
|
||||
out.ClientAffinityEnabled = &enabled
|
||||
|
||||
@@ -188,7 +188,7 @@ type Account struct {
|
||||
CacheTTLOverrideEnabled *bool `json:"cache_ttl_override_enabled,omitempty"`
|
||||
CacheTTLOverrideTarget *string `json:"cache_ttl_override_target,omitempty"`
|
||||
|
||||
// 客户端亲和调度(仅 Anthropic/Antigravity 平台有效)
|
||||
// 客户端亲和调度(仅 Anthropic OAuth/SetupToken 账号有效)
|
||||
// 启用后新会话会优先调度到客户端之前使用过的账号
|
||||
ClientAffinityEnabled *bool `json:"client_affinity_enabled,omitempty"`
|
||||
|
||||
|
||||
@@ -1100,10 +1100,10 @@ func (a *Account) IsSessionIDMaskingEnabled() bool {
|
||||
}
|
||||
|
||||
// IsClientAffinityEnabled 检查是否启用客户端亲和调度
|
||||
// 仅适用于 Anthropic 平台账号(包括 anthropic 和 antigravity 平台)
|
||||
// 仅适用于 Anthropic OAuth/SetupToken 账号(Claude Code)
|
||||
// 启用后,新会话会优先调度到之前使用过的账号
|
||||
func (a *Account) IsClientAffinityEnabled() bool {
|
||||
if a.Platform != PlatformAnthropic && a.Platform != PlatformAntigravity {
|
||||
if !a.IsAnthropicOAuthOrSetupToken() {
|
||||
return false
|
||||
}
|
||||
if a.Extra == nil {
|
||||
|
||||
Reference in new issue
Block a user