From 87224d8e2544d5235cd0576da797a5680728c3e5 Mon Sep 17 00:00:00 2001 From: connorwalker Date: Fri, 9 Oct 2026 14:49:22 +0100 Subject: [PATCH 1/2] fix(codex): disable native agents for ChatGPT sharing --- .../src/provider/CodexManagedErrors.test.ts | 20 +++++++++++++++++++ .../server/src/provider/CodexManagedErrors.ts | 7 +++++++ .../src/provider/CodexManagedRuntime.test.ts | 2 ++ .../src/provider/CodexManagedRuntime.ts | 2 ++ 4 files changed, 31 insertions(+) diff --git a/apps/server/src/provider/CodexManagedErrors.test.ts b/apps/server/src/provider/CodexManagedErrors.test.ts index a1f253c922ed..af956795216c 100644 --- a/apps/server/src/provider/CodexManagedErrors.test.ts +++ b/apps/server/src/provider/CodexManagedErrors.test.ts @@ -62,3 +62,23 @@ it("preserves credentials for the current subscriber and permission error codes" assert.isFalse(classifyCodexManagedError({ error: { code } })!.revoke); } }); + +it("explains unsupported conversation input without suggesting a credential reset", () => { + const response = { + error: { + message: + "User subscription sharing currently supports only text, image, and file messages, item references, additional tools, compaction summaries, reasoning items, Web Search call items, developer function and custom tool call items, and programmatic tool calling items. Remove unsupported input items or use an API key instead. dummy-sensitive", + type: "invalid_request_error", + param: "input", + code: "subscription_sharing_unsupported_capability", + }, + }; + for (const value of [response, JSON.stringify(response)]) { + const failure = classifyCodexManagedError(value); + assert.isDefined(failure); + assert.include(failure!.message, "unsupported input item"); + assert.include(failure!.message, "Start a new thread"); + assert.notInclude(failure!.message, "dummy-sensitive"); + assert.isFalse(failure!.revoke); + } +}); diff --git a/apps/server/src/provider/CodexManagedErrors.ts b/apps/server/src/provider/CodexManagedErrors.ts index 9c8fe26bbb6e..3936df5f08a6 100644 --- a/apps/server/src/provider/CodexManagedErrors.ts +++ b/apps/server/src/provider/CodexManagedErrors.ts @@ -66,6 +66,13 @@ export function classifyCodexManagedError(value: unknown) { for (const [code, failure] of Object.entries(failures)) { if (!text.includes(code)) continue; if (code === "subscription_sharing_unsupported_capability") { + if (text.includes("User subscription sharing currently supports only")) + return { + ...failure, + code, + message: + "ChatGPT sharing rejected an unsupported input item in this conversation. Start a new thread with a compatible runtime; retrying this conversation may repeat the error.", + }; if (text.includes("tool 'namespace'")) return { ...failure, diff --git a/apps/server/src/provider/CodexManagedRuntime.test.ts b/apps/server/src/provider/CodexManagedRuntime.test.ts index cf95d981d8a5..69d27f1377b6 100644 --- a/apps/server/src/provider/CodexManagedRuntime.test.ts +++ b/apps/server/src/provider/CodexManagedRuntime.test.ts @@ -163,6 +163,8 @@ it.effect.each( 'model_providers.openai_token_sharing.model_catalog_url="https://api.openai.com/v1/models"', ); assert.include(args, "features.api_key_model_discovery=true"); + assert.include(args, "features.multi_agent=false"); + assert.include(args, "features.multi_agent_v2=false"); assert.notInclude(effective.config.launchArgs, "model_catalog_json"); assert.notInclude(effective.config.launchArgs, "x-openai-chatpass-test"); assert.include(args, "model_providers.openai_token_sharing.supports_websockets=false"); diff --git a/apps/server/src/provider/CodexManagedRuntime.ts b/apps/server/src/provider/CodexManagedRuntime.ts index f21cc6c3bcf3..fd8f3d7a9cd9 100644 --- a/apps/server/src/provider/CodexManagedRuntime.ts +++ b/apps/server/src/provider/CodexManagedRuntime.ts @@ -22,6 +22,8 @@ const managedCodexLaunchArgs = [ 'model_providers.openai_token_sharing.base_url="https://api.openai.com/v1"', 'model_providers.openai_token_sharing.model_catalog_url="https://api.openai.com/v1/models"', "features.api_key_model_discovery=true", + "features.multi_agent=false", + "features.multi_agent_v2=false", 'model_providers.openai_token_sharing.env_key="ACCESS_TOKEN"', 'model_providers.openai_token_sharing.wire_api="responses"', "model_providers.openai_token_sharing.requires_openai_auth=false", From d3b6bab9f4c4bd4df0ca62fe85f802ddf30fa015 Mon Sep 17 00:00:00 2001 From: connorwalker Date: Fri, 9 Oct 2026 15:06:46 +0100 Subject: [PATCH 2/2] fix(codex): keep compatibility patch scoped to runtime --- .../src/provider/CodexManagedErrors.test.ts | 20 ------------------- .../server/src/provider/CodexManagedErrors.ts | 7 ------- 2 files changed, 27 deletions(-) diff --git a/apps/server/src/provider/CodexManagedErrors.test.ts b/apps/server/src/provider/CodexManagedErrors.test.ts index af956795216c..a1f253c922ed 100644 --- a/apps/server/src/provider/CodexManagedErrors.test.ts +++ b/apps/server/src/provider/CodexManagedErrors.test.ts @@ -62,23 +62,3 @@ it("preserves credentials for the current subscriber and permission error codes" assert.isFalse(classifyCodexManagedError({ error: { code } })!.revoke); } }); - -it("explains unsupported conversation input without suggesting a credential reset", () => { - const response = { - error: { - message: - "User subscription sharing currently supports only text, image, and file messages, item references, additional tools, compaction summaries, reasoning items, Web Search call items, developer function and custom tool call items, and programmatic tool calling items. Remove unsupported input items or use an API key instead. dummy-sensitive", - type: "invalid_request_error", - param: "input", - code: "subscription_sharing_unsupported_capability", - }, - }; - for (const value of [response, JSON.stringify(response)]) { - const failure = classifyCodexManagedError(value); - assert.isDefined(failure); - assert.include(failure!.message, "unsupported input item"); - assert.include(failure!.message, "Start a new thread"); - assert.notInclude(failure!.message, "dummy-sensitive"); - assert.isFalse(failure!.revoke); - } -}); diff --git a/apps/server/src/provider/CodexManagedErrors.ts b/apps/server/src/provider/CodexManagedErrors.ts index 3936df5f08a6..9c8fe26bbb6e 100644 --- a/apps/server/src/provider/CodexManagedErrors.ts +++ b/apps/server/src/provider/CodexManagedErrors.ts @@ -66,13 +66,6 @@ export function classifyCodexManagedError(value: unknown) { for (const [code, failure] of Object.entries(failures)) { if (!text.includes(code)) continue; if (code === "subscription_sharing_unsupported_capability") { - if (text.includes("User subscription sharing currently supports only")) - return { - ...failure, - code, - message: - "ChatGPT sharing rejected an unsupported input item in this conversation. Start a new thread with a compatible runtime; retrying this conversation may repeat the error.", - }; if (text.includes("tool 'namespace'")) return { ...failure,