From 7582dc53d2dccbe4ae093209361c2fd3f6df5f21 Mon Sep 17 00:00:00 2001 From: yangjianbo Date: Thu, 12 Feb 2026 23:15:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(openai):=20=E4=BF=AE=E5=A4=8D=E5=85=B3?= =?UTF-8?q?=E9=97=AD=20codex=5Fcli=5Fonly=20=E6=97=A0=E6=B3=95=E6=8C=81?= =?UTF-8?q?=E4=B9=85=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在编辑 OpenAI OAuth 账号时,若 codex_cli_only 从开启切换为关闭, 现改为显式写入 false,避免 extra 为空时后端忽略更新导致旧值残留。 Co-Authored-By: Claude Opus 4.6 --- backend/cmd/server/VERSION | 2 +- .../src/components/account/EditAccountModal.vue | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/cmd/server/VERSION b/backend/cmd/server/VERSION index 1734876e..1fb19d78 100644 --- a/backend/cmd/server/VERSION +++ b/backend/cmd/server/VERSION @@ -1 +1 @@ -0.1.74.5 +0.1.74.6 diff --git a/frontend/src/components/account/EditAccountModal.vue b/frontend/src/components/account/EditAccountModal.vue index 8299b72b..8986a350 100644 --- a/frontend/src/components/account/EditAccountModal.vue +++ b/frontend/src/components/account/EditAccountModal.vue @@ -1823,6 +1823,7 @@ const handleSubmit = async () => { if (props.account.platform === 'openai' && (props.account.type === 'oauth' || props.account.type === 'apikey')) { const currentExtra = (props.account.extra as Record) || {} const newExtra: Record = { ...currentExtra } + const hadCodexCLIOnlyEnabled = currentExtra.codex_cli_only === true if (openaiPassthroughEnabled.value) { newExtra.openai_passthrough = true } else { @@ -1830,10 +1831,15 @@ const handleSubmit = async () => { delete newExtra.openai_oauth_passthrough } - if (props.account.type === 'oauth' && codexCLIOnlyEnabled.value) { - newExtra.codex_cli_only = true - } else { - delete newExtra.codex_cli_only + if (props.account.type === 'oauth') { + if (codexCLIOnlyEnabled.value) { + newExtra.codex_cli_only = true + } else if (hadCodexCLIOnlyEnabled) { + // 关闭时显式写 false,避免 extra 为空被后端忽略导致旧值无法清除 + newExtra.codex_cli_only = false + } else { + delete newExtra.codex_cli_only + } } updatePayload.extra = newExtra