From dfd496b41ae185f2537e57023773679a91ec0723 Mon Sep 17 00:00:00 2001 From: zyycn Date: Sun, 26 Jul 2026 06:17:21 +0800 Subject: [PATCH] fix(ui): restore standard Codex API key setup Remove command-backed provider auth from the generated configuration and use auth.json again. Co-authored-by: Codex --- .../api-keys/components/ApiKeyUseModal.vue | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/frontend/src/views/api-keys/components/ApiKeyUseModal.vue b/frontend/src/views/api-keys/components/ApiKeyUseModal.vue index 2b0b96e71..943e43ffb 100644 --- a/frontend/src/views/api-keys/components/ApiKeyUseModal.vue +++ b/frontend/src/views/api-keys/components/ApiKeyUseModal.vue @@ -35,23 +35,13 @@ const configPath = computed(() => ? '%userprofile%\\.codex\\config.toml' : '~/.codex/config.toml', ) -const tokenPath = computed(() => - activePlatform.value === 'windows' - ? '%userprofile%\\.codex\\codex-proxy.token' - : '~/.codex/codex-proxy.token', +const authPath = computed(() => + activePlatform.value === 'windows' ? '%userprofile%\\.codex\\auth.json' : '~/.codex/auth.json', ) +const codexAuthJson = computed(() => JSON.stringify({ OPENAI_API_KEY: keyValue.value }, null, 2)) const defaultModel = computed(() => props.apiKey?.providerKind?.trim().toLowerCase() === 'xai' ? 'grok-4.5' : 'gpt-5.5', ) -const providerAuthToml = computed(() => - activePlatform.value === 'windows' - ? `[model_providers.OpenAI.auth] -command = "powershell.exe" -args = ["-NoLogo", "-NoProfile", "-NonInteractive", "-Command", "Get-Content -Raw (Join-Path (Join-Path $env:USERPROFILE '.codex') 'codex-proxy.token')"]` - : `[model_providers.OpenAI.auth] -command = "sh" -args = ["-c", 'cat "$HOME/.codex/codex-proxy.token"']`, -) const codexConfigToml = computed( () => `model_provider = "OpenAI" @@ -67,8 +57,7 @@ windows_wsl_setup_acknowledged = true name = "OpenAI" base_url = "${props.apiBaseUrl}" wire_api = "responses" - -${providerAuthToml.value} +requires_openai_auth = true [features] goals = true`, @@ -76,7 +65,7 @@ goals = true`, const visibleFiles = computed(() => [ { path: configPath.value, content: codexConfigToml.value }, - { path: tokenPath.value, content: keyValue.value }, + { path: authPath.value, content: codexAuthJson.value }, ])