From c28f691f32e0b90d0b1e2c9ab31915b8f8017426 Mon Sep 17 00:00:00 2001 From: erio Date: Fri, 6 Mar 2026 14:32:08 +0800 Subject: [PATCH] fix(openai): remove misplaced passthrough check from isModelSupportedByAccount MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit isModelSupportedByAccount 不被 OpenAI 调度路径调用, OpenAI /responses 和 /chat/completions 走的是 openai_account_scheduler.go,透传短路已在 PR #806 的 第二个 commit 中正确添加到该文件。 此处的检查是多余的死代码,因为 OpenAI 账号不会走到 isModelSupportedByAccount 的这个分支。 --- backend/internal/service/gateway_service.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/backend/internal/service/gateway_service.go b/backend/internal/service/gateway_service.go index 9f5c8299..075f3ef0 100644 --- a/backend/internal/service/gateway_service.go +++ b/backend/internal/service/gateway_service.go @@ -3320,10 +3320,6 @@ func (s *GatewayService) isModelSupportedByAccount(account *Account, requestedMo if account.Platform == PlatformSora { return s.isSoraModelSupportedByAccount(account, requestedModel) } - // OpenAI 透传模式:仅替换认证,允许所有模型 - if account.Platform == PlatformOpenAI && account.IsOpenAIPassthroughEnabled() { - return true - } // OAuth/SetupToken 账号使用 Anthropic 标准映射(短ID → 长ID) if account.Platform == PlatformAnthropic && account.Type != AccountTypeAPIKey { requestedModel = claude.NormalizeModelID(requestedModel)