mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-21 09:09:53 +00:00
revert(grok): 撤回 405 账号级踢号,只保留 failover 分类
tempUnscheduleGrok 是账号级、全端点、全模型的下线,而 handleGrokAccountUpstreamError 有 8 个调用点(raw chat / Grok 媒体 / CC 管线 / WS HTTP 桥接 / responses), /v1/responses 的 405 只证明该端点缺失,账号在其他端点上仍然健康。 仓库里已有相反的既定不变式:shouldApplyOpenAIAlphaSearchAccountErrorSideEffects 把 404/405 显式排除在账号状态写入之外,注释写明「端点不存在只说明该上游不支持 独立搜索,账号本身健康」。 failover 分类器加 405 单独就能解开 sticky 锁死(调度器选号时会即时改绑 sticky), 账号级冷却不是必需的。「405 不踢号但记住端点能力」按端点级负缓存另行处理。
This commit is contained in:
@@ -1370,8 +1370,6 @@ func (s *OpenAIGatewayService) handleGrokAccountUpstreamError(ctx context.Contex
|
||||
s.tempUnscheduleGrok(ctx, account, 30*time.Minute, "grok payment required")
|
||||
case http.StatusForbidden:
|
||||
s.tempUnscheduleGrok(ctx, account, 30*time.Minute, "grok access or entitlement denied")
|
||||
case http.StatusMethodNotAllowed:
|
||||
s.tempUnscheduleGrok(ctx, account, 30*time.Minute, "grok endpoint not supported (405)")
|
||||
case http.StatusTooManyRequests:
|
||||
// updateGrokUsageSnapshot installs rate-limit state for non-pool accounts.
|
||||
default:
|
||||
|
||||
@@ -2583,13 +2583,6 @@ func TestHandleGrokAccountUpstreamErrorTempUnschedulesNonRateLimitStates(t *test
|
||||
wantMinCooldown: 2*time.Minute - time.Second,
|
||||
wantMaxCooldown: 2*time.Minute + time.Second,
|
||||
},
|
||||
{
|
||||
name: "method not allowed",
|
||||
status: http.StatusMethodNotAllowed,
|
||||
wantReason: "grok endpoint not supported (405)",
|
||||
wantMinCooldown: 30*time.Minute - time.Second,
|
||||
wantMaxCooldown: 30*time.Minute + time.Second,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user