From fedbcf7f867c4ba57921bf1011a1fe4058b7e359 Mon Sep 17 00:00:00 2001 From: Chang Wang <743976+cheapsteak@users.noreply.github.com> Date: Mon, 11 May 2026 13:14:01 -0400 Subject: [PATCH] =?UTF-8?q?fix(codex):=20drop=20user=20parameter=20?= =?UTF-8?q?=E2=80=94=20ChatGPT=20backend=20rejects=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ChatGPT Codex backend (consumed via the Anthropic → Responses translator) rejects requests that include a top-level `user` field with: HTTP 400 {"detail":"Unsupported parameter: user"} Claude Code (and any Anthropic-protocol client that populates `metadata.user_id`) hits this on every request, making the codex provider unusable from Claude Code. Drop the `metadata.user_id` → `user` forward in `anthropicToResponsesRequest`. A comment is left in its place so the constraint isn't accidentally re-added. --- src/upstream/responses-translator.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/upstream/responses-translator.ts b/src/upstream/responses-translator.ts index 930141c..11d468d 100644 --- a/src/upstream/responses-translator.ts +++ b/src/upstream/responses-translator.ts @@ -310,7 +310,9 @@ export function anthropicToResponsesRequest(body: any): any { if (body.max_tokens !== undefined) out.max_output_tokens = body.max_tokens; if (body.temperature !== undefined) out.temperature = body.temperature; if (body.top_p !== undefined) out.top_p = body.top_p; - if (body.metadata?.user_id) out.user = body.metadata.user_id; + // NOTE: Do not forward `metadata.user_id` as `user`. The ChatGPT Codex + // backend (the only consumer of this translator) rejects requests that + // include `user` with HTTP 400 `{"detail":"Unsupported parameter: user"}`. // Anthropic `system` can be a string or [{type:"text", text}] array. if (body.system) {