From b1123261a9901b087cc2fa4b99f58c024b36eded Mon Sep 17 00:00:00 2001 From: Emanuel Scirlet Date: Fri, 13 Nov 2026 16:44:39 +0100 Subject: [PATCH] fix(server): ChatGPT sharing input-item rejections get their specific message ChatGPT sharing rejects an unsupported input item with prose that lists "additional tools" as supported and ends "Remove unsupported input items", so the `additional_tools` check never matched and users saw the generic "Codex used a feature" message. Match "input item" instead. --- apps/server/src/provider/CodexManagedErrors.test.ts | 4 ++++ apps/server/src/provider/CodexManagedErrors.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/server/src/provider/CodexManagedErrors.test.ts b/apps/server/src/provider/CodexManagedErrors.test.ts index 753fad49d0d0a..16791c36b7076 100644 --- a/apps/server/src/provider/CodexManagedErrors.test.ts +++ b/apps/server/src/provider/CodexManagedErrors.test.ts @@ -36,6 +36,10 @@ it("distinguishes unsupported tools from input items without exposing the raw re for (const [detail, expected] of [ ["tool 'namespace' is not supported", "tool namespace"], ["input item 'additional_tools' is not supported", "input item"], + [ + "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.", + "input item", + ], ]) { const response = { error: { code, message: `${detail}; dummy-sensitive` } }; for (const value of [response, JSON.stringify(response)]) { diff --git a/apps/server/src/provider/CodexManagedErrors.ts b/apps/server/src/provider/CodexManagedErrors.ts index 4cad5709d2eb0..b8388e3751449 100644 --- a/apps/server/src/provider/CodexManagedErrors.ts +++ b/apps/server/src/provider/CodexManagedErrors.ts @@ -105,7 +105,8 @@ export function classifyCodexManagedError(value: unknown) { message: "Codex sent a tool namespace that ChatGPT sharing does not support. Use another provider for this request.", }; - if (text.includes("additional_tools")) + // ChatGPT lists `additional tools` as supported and says "Remove unsupported input items". + if (text.includes("input item")) return { ...failure, message: