From f70a129b788bdbc3504acab46f2221977647ab98 Mon Sep 17 00:00:00 2001 From: yinaoxiong Date: Fri, 10 Jul 2026 14:42:06 -0300 Subject: [PATCH 1/2] fix(codex): strip include from compact responses requests Reconstructed onto release/v3.8.47 to drop unrelated main-drift (deps/electron/proxy files belong to #6620, not this PR); keeps only the author's changes. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --- .../fixes/6805-strip-include-compact-responses.md | 1 + open-sse/executors/codex.ts | 12 ++++++++++-- tests/unit/executor-codex.test.ts | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 changelog.d/fixes/6805-strip-include-compact-responses.md diff --git a/changelog.d/fixes/6805-strip-include-compact-responses.md b/changelog.d/fixes/6805-strip-include-compact-responses.md new file mode 100644 index 00000000000..6c46a717a42 --- /dev/null +++ b/changelog.d/fixes/6805-strip-include-compact-responses.md @@ -0,0 +1 @@ +- **fix(codex): strip include from compact responses requests** (#6805 — thanks @yinaoxiong). diff --git a/open-sse/executors/codex.ts b/open-sse/executors/codex.ts index 6bca470eb55..ceaa8bda692 100644 --- a/open-sse/executors/codex.ts +++ b/open-sse/executors/codex.ts @@ -894,7 +894,9 @@ export class CodexExecutor extends BaseExecutor { headers["chatgpt-account-id"] = workspaceId; } const clientIdentity = credentials?.providerSpecificData?.codexClientIdentity as - CodexClientIdentity | null | undefined; + | CodexClientIdentity + | null + | undefined; // Originator header — identifies the client type to the Codex backend. // Ref: openai/codex login/src/auth/default_client.rs DEFAULT_ORIGINATOR = "codex_cli_rs" @@ -1001,6 +1003,7 @@ export class CodexExecutor extends BaseExecutor { delete body.stream; delete body.stream_options; delete body.client_metadata; + delete body.include; } else { body.stream = true; } @@ -1174,6 +1177,9 @@ export class CodexExecutor extends BaseExecutor { }; } ensureCodexReasoningSummary(body); + if (isCompactRequest) { + delete body.include; + } delete body.reasoning_effort; // Remove unsupported token limit parameters BEFORE the passthrough return. @@ -1214,7 +1220,9 @@ export class CodexExecutor extends BaseExecutor { applyCodexClientMetadata( body, credentials?.providerSpecificData?.codexClientIdentity as - CodexClientIdentity | null | undefined + | CodexClientIdentity + | null + | undefined ); } diff --git a/tests/unit/executor-codex.test.ts b/tests/unit/executor-codex.test.ts index 9b4ecaa7da4..556c7791245 100644 --- a/tests/unit/executor-codex.test.ts +++ b/tests/unit/executor-codex.test.ts @@ -375,6 +375,7 @@ test("CodexExecutor.transformRequest preserves compact requests and native passt const executor = new CodexExecutor(); const body = { _nativeCodexPassthrough: true, + include: ["reasoning.encrypted_content"], instructions: "keep this", stream: false, }; @@ -389,6 +390,7 @@ test("CodexExecutor.transformRequest preserves compact requests and native passt assert.equal(result.stream, undefined); assert.equal(result.service_tier, "priority"); assert.equal(result.reasoning.effort, "medium"); + assert.equal(result.include, undefined); assert.equal(result.store, undefined); assert.equal(result.instructions, "keep this"); }); From 7f9aef23d6fd3a9ac2178c844abef635dad1b33f Mon Sep 17 00:00:00 2001 From: yinaoxiong Date: Fri, 10 Jul 2026 15:38:50 -0300 Subject: [PATCH 2/2] fix(6805): move include-strip assertion to standalone test file to keep executor-codex.test.ts under frozen size cap Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> --- .../codex-compact-strip-include-6805.test.ts | 28 +++++++++++++++++++ tests/unit/executor-codex.test.ts | 2 -- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 tests/unit/codex-compact-strip-include-6805.test.ts diff --git a/tests/unit/codex-compact-strip-include-6805.test.ts b/tests/unit/codex-compact-strip-include-6805.test.ts new file mode 100644 index 00000000000..91e0d080c3f --- /dev/null +++ b/tests/unit/codex-compact-strip-include-6805.test.ts @@ -0,0 +1,28 @@ +import test from "node:test"; +import assert from "node:assert/strict"; + +import { CodexExecutor } from "../../open-sse/executors/codex.ts"; + +// #6805: compact Codex requests must not forward `include` (e.g. +// "reasoning.encrypted_content") — the compact endpoint rejects it. Kept in a +// standalone file so the frozen executor-codex.test.ts does not grow past its cap. +test("CodexExecutor.transformRequest strips include from compact requests (#6805)", () => { + const executor = new CodexExecutor(); + const result = executor.transformRequest( + "gpt-5.3-codex", + { + _nativeCodexPassthrough: true, + include: ["reasoning.encrypted_content"], + instructions: "keep this", + stream: false, + }, + false, + { + requestEndpointPath: "/responses/compact", + providerSpecificData: { requestDefaults: { serviceTier: "priority" } }, + } + ); + assert.equal(result.include, undefined); + assert.equal(result._nativeCodexPassthrough, undefined); + assert.equal(result.instructions, "keep this"); +}); diff --git a/tests/unit/executor-codex.test.ts b/tests/unit/executor-codex.test.ts index 556c7791245..9b4ecaa7da4 100644 --- a/tests/unit/executor-codex.test.ts +++ b/tests/unit/executor-codex.test.ts @@ -375,7 +375,6 @@ test("CodexExecutor.transformRequest preserves compact requests and native passt const executor = new CodexExecutor(); const body = { _nativeCodexPassthrough: true, - include: ["reasoning.encrypted_content"], instructions: "keep this", stream: false, }; @@ -390,7 +389,6 @@ test("CodexExecutor.transformRequest preserves compact requests and native passt assert.equal(result.stream, undefined); assert.equal(result.service_tier, "priority"); assert.equal(result.reasoning.effort, "medium"); - assert.equal(result.include, undefined); assert.equal(result.store, undefined); assert.equal(result.instructions, "keep this"); });