From 5620cd6bacd216dada8861d94dd8bd38aefc0703 Mon Sep 17 00:00:00 2001 From: debug-zhang <34176152+debug-zhang@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:19:00 +0800 Subject: [PATCH] fix(frontend): drop Codex config keys removed upstream Codex 0.17x reports `disable_response_storage` and `windows_wsl_setup_acknowledged` as unknown configuration fields, and rejects the top-level `network_access = "enabled"` because the key only exists as a boolean under [sandbox_workspace_write]. Remove the two removed keys from every generated config.toml and express the network intent with the supported sandbox table. The commented Grok template drops the same stale lines. --- frontend/src/components/keys/UseKeyModal.vue | 16 +++--- .../keys/__tests__/UseKeyModal.spec.ts | 52 +++++++++++++++++++ 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/keys/UseKeyModal.vue b/frontend/src/components/keys/UseKeyModal.vue index 26c36a1fec..f64514144c 100644 --- a/frontend/src/components/keys/UseKeyModal.vue +++ b/frontend/src/components/keys/UseKeyModal.vue @@ -1036,9 +1036,9 @@ function generateOpenAIFiles(baseUrl: string, apiKey: string): FileConfig[] { model = "${model}" review_model = "${model}" web_search = "live" -${reasoningEffortLine}disable_response_storage = true -${codexLocalCatalogToml.value}network_access = "enabled" -windows_wsl_setup_acknowledged = true +${reasoningEffortLine}${codexLocalCatalogToml.value} +[sandbox_workspace_write] +network_access = true [model_providers.OpenAI] name = "OpenAI" @@ -1271,9 +1271,6 @@ ${codexLocalCatalogToml.value}# Optional: # review_model = "${model}" # model_reasoning_effort = "medium" # model_context_window = 500000 -# disable_response_storage = true -# network_access = "enabled" -# windows_wsl_setup_acknowledged = true [model_providers.sub2api] name = "Sub2API Grok" @@ -1348,7 +1345,6 @@ function generateRoutedCodexFiles( model_provider = "sub2api" model = "${model}" review_model = "${model}" -disable_response_storage = true ${codexLocalCatalogToml.value} [model_providers.sub2api] name = "Sub2API ${label}" @@ -1383,9 +1379,9 @@ function generateOpenAIWsFiles(baseUrl: string, apiKey: string): FileConfig[] { model = "${model}" review_model = "${model}" web_search = "live" -${reasoningEffortLine}disable_response_storage = true -${codexLocalCatalogToml.value}network_access = "enabled" -windows_wsl_setup_acknowledged = true +${reasoningEffortLine}${codexLocalCatalogToml.value} +[sandbox_workspace_write] +network_access = true [model_providers.OpenAI] name = "OpenAI" diff --git a/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts b/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts index 46233b7908..9ed9aeac57 100644 --- a/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts +++ b/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts @@ -1150,4 +1150,56 @@ describe('UseKeyModal', () => { } } ) + + // Codex rejects these removed top-level keys, and network_access now only + // exists as a boolean under [sandbox_workspace_write]. + it('generates only config keys supported by current Codex clients', async () => { + const wrapper = mount(UseKeyModal, { + props: { + show: true, + apiKey: 'sk-test', + baseUrl: 'https://example.com/v1', + platform: 'openai' + }, + global: { + stubs: { + BaseDialog: { template: '