mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-21 22:31:42 +08:00
fix(openai): 移除 #4269 合并时复活的旧版 Grok 错误路径处理
#4269 分支基于 #4212 之前的 main(merge-base da85cc7e),合并后把 ForwardAsAnthropic 错误路径上已被 #4212 重构移除的 Grok 块带了回来: - xai.ParseQuotaHeaders 的 import 已被 main 删除,导致 main 编译失败; - 该块与 failoverOpenAIUpstreamHTTPError 内部的 handleGrokAccountUpstreamError 重复(后者第一步就用新解析器 parseGrokQuotaSnapshot 更新配额快照), 保留会造成 Grok 错误双重处置。 删除整块,恢复 #4212 语义;#4269 的 agent identity 恢复逻辑保留不动。
This commit is contained in:
@@ -330,10 +330,6 @@ func (s *OpenAIGatewayService) ForwardAsAnthropic(
|
||||
}
|
||||
return s.ForwardAsAnthropic(markAgentIdentityTaskRecoveryTried(ctx), c, account, body, promptCacheKey, defaultMappedModel)
|
||||
}
|
||||
if account.Platform == PlatformGrok {
|
||||
s.updateGrokUsageSnapshot(ctx, account, xai.ParseQuotaHeaders(resp.Header, resp.StatusCode))
|
||||
s.handleGrokAccountUpstreamError(ctx, account, resp.StatusCode, resp.Header, respBody)
|
||||
}
|
||||
if previousResponseID != "" && (isOpenAICompatPreviousResponseNotFound(resp.StatusCode, upstreamMsg, respBody) || isOpenAICompatPreviousResponseUnsupported(resp.StatusCode, upstreamMsg, respBody)) {
|
||||
if isOpenAICompatPreviousResponseUnsupported(resp.StatusCode, upstreamMsg, respBody) {
|
||||
s.disableOpenAICompatSessionContinuation(ctx, c, account, promptCacheKey)
|
||||
|
||||
Reference in New Issue
Block a user