From a2432c54d16783c5ed910ea4c67d7e18d27b97b6 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Tue, 21 Jul 2026 05:28:17 -0300 Subject: [PATCH 1/2] fix(sse): preserve parallel_tool_calls for GPT-5.6 ultra/max delegation under Codex Responses Lite (#7821) --- .../fixes/7821-gpt56-codex-responses-lite.md | 1 + open-sse/executors/codex.ts | 27 +++++- .../executor-codex-gpt56-lite-ultra.test.ts | 89 +++++++++++++++++++ 3 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 changelog.d/fixes/7821-gpt56-codex-responses-lite.md create mode 100644 tests/unit/executor-codex-gpt56-lite-ultra.test.ts diff --git a/changelog.d/fixes/7821-gpt56-codex-responses-lite.md b/changelog.d/fixes/7821-gpt56-codex-responses-lite.md new file mode 100644 index 000000000000..ca852493aa23 --- /dev/null +++ b/changelog.d/fixes/7821-gpt56-codex-responses-lite.md @@ -0,0 +1 @@ +- fix(sse): preserve parallel_tool_calls for GPT-5.6 ultra/max delegation under Codex Responses Lite (#7821) diff --git a/open-sse/executors/codex.ts b/open-sse/executors/codex.ts index 46cb7ae7d04b..ad7b31d1efde 100644 --- a/open-sse/executors/codex.ts +++ b/open-sse/executors/codex.ts @@ -153,15 +153,28 @@ function isCodexResponsesLiteRequest( ); } +// GPT-5.6 ultra-tier (sol/terra at "ultra") and luna at "max" coordinate delegation to +// sub-agents via parallel tool calls (see the effort-clamp comment near clampEffort()). +// Responses Lite must not strip parallel_tool_calls for those model/effort combos, or +// delegation silently breaks while the request still returns HTTP 200 (issue #7821). +function isCodexDelegationDependentModel(model: unknown): boolean { + const { baseModel, effort } = splitCodexReasoningSuffix(model); + if (effort === "ultra" && GPT_5_6_ULTRA_ALIAS_MODELS.has(baseModel)) return true; + if (effort === "max" && baseModel === "gpt-5.6-luna") return true; + return false; +} + function enforceCodexResponsesLiteParallelToolCalls( bodyInput: unknown, - clientHeaders?: Record | null + clientHeaders: Record | null | undefined, + model: unknown ): unknown { if ( !isCodexResponsesLiteRequest(bodyInput, clientHeaders) || !bodyInput || typeof bodyInput !== "object" || - Array.isArray(bodyInput) + Array.isArray(bodyInput) || + isCodexDelegationDependentModel(model) ) { return bodyInput; } @@ -847,7 +860,11 @@ export class CodexExecutor extends BaseExecutor { } async execute(input: ExecuteInput) { - const requestBody = enforceCodexResponsesLiteParallelToolCalls(input.body, input.clientHeaders); + const requestBody = enforceCodexResponsesLiteParallelToolCalls( + input.body, + input.clientHeaders, + input.model + ); const requestInput = requestBody === input.body ? input : { ...input, body: requestBody }; const sessionId = this.getPromptCacheSessionId( requestInput.credentials, @@ -1496,6 +1513,10 @@ export class CodexExecutor extends BaseExecutor { "client_metadata", // GPT-5 output verbosity ({ verbosity } — normalized above by normalizeCodexVerbosity). "text", + // Preserve Responses Lite delegation state (#7821) on the Chat-Completions-translated + // (non-native) path so it isn't dropped a second time after enforceCodexResponsesLite... + // already decided whether to keep or strip it. + "parallel_tool_calls", // Internal markers used by OmniRoute pipeline "_omnirouteResponsesStore", ]); diff --git a/tests/unit/executor-codex-gpt56-lite-ultra.test.ts b/tests/unit/executor-codex-gpt56-lite-ultra.test.ts new file mode 100644 index 000000000000..ed0995e17b14 --- /dev/null +++ b/tests/unit/executor-codex-gpt56-lite-ultra.test.ts @@ -0,0 +1,89 @@ +import test from "node:test"; +import assert from "node:assert/strict"; + +import { CodexExecutor } from "../../open-sse/executors/codex.ts"; + +// Issue #7821: enforceCodexResponsesLiteParallelToolCalls() used to have zero model +// awareness — it force-set parallel_tool_calls:false for EVERY model when Responses +// Lite was detected, including gpt-5.6-sol/-terra at "ultra" effort (and gpt-5.6-luna +// at "max"), whose delegation-to-sub-agents capability depends on parallel_tool_calls +// staying enabled. This collided with the effort-clamp comment near clampEffort() +// ("Ultra coordinates delegation in Codex clients") and is why GPT-5.6 was reported +// unusable through the stock Codex CLI/App (which enables Responses Lite by default) +// while GPT-5.5 (no delegation tier) was unaffected. +// +// Covers the interaction (lite marker + delegation-dependent model/effort together), +// not just each behavior in isolation — that interaction was the actual blind spot. + +async function runLiteRequest(model: string): Promise[]> { + const executor = new CodexExecutor(); + const originalFetch = globalThis.fetch; + const capturedBodies: Record[] = []; + + globalThis.fetch = async (_url, init) => { + capturedBodies.push(JSON.parse(String(init?.body || "{}"))); + return new Response(JSON.stringify({ id: "resp_lite", object: "response" }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + }; + + const body = { + _nativeCodexPassthrough: true, + model, + input: [], + parallel_tool_calls: true, + }; + + try { + await executor.execute({ + model, + body, + stream: true, + credentials: { accessToken: "codex-token" }, + clientHeaders: { "X-OpenAI-Internal-Codex-Responses-Lite": "true" }, + }); + } finally { + globalThis.fetch = originalFetch; + } + + return capturedBodies; +} + +test("Responses Lite must not strip parallel_tool_calls for GPT-5.6 sol ultra-tier delegation", async () => { + const capturedBodies = await runLiteRequest("gpt-5.6-sol-ultra"); + assert.equal( + capturedBodies[0].parallel_tool_calls, + true, + "Responses Lite stripped parallel_tool_calls for an ultra-tier GPT-5.6 delegation " + + "request — this breaks sub-agent delegation and is the root cause of #7821" + ); +}); + +test("Responses Lite must not strip parallel_tool_calls for GPT-5.6 terra ultra-tier delegation", async () => { + const capturedBodies = await runLiteRequest("gpt-5.6-terra-ultra"); + assert.equal(capturedBodies[0].parallel_tool_calls, true); +}); + +test("Responses Lite must not strip parallel_tool_calls for GPT-5.6 luna max-tier delegation", async () => { + const capturedBodies = await runLiteRequest("gpt-5.6-luna-max"); + assert.equal(capturedBodies[0].parallel_tool_calls, true); +}); + +test("Responses Lite still forces parallel_tool_calls:false for non-delegation GPT-5.5", async () => { + const capturedBodies = await runLiteRequest("gpt-5.5"); + assert.equal( + capturedBodies[0].parallel_tool_calls, + false, + "GPT-5.5 has no delegation tier — Responses Lite behavior for it must be unchanged" + ); +}); + +test("Responses Lite still forces parallel_tool_calls:false for GPT-5.6 sol at non-ultra effort", async () => { + const capturedBodies = await runLiteRequest("gpt-5.6-sol-high"); + assert.equal( + capturedBodies[0].parallel_tool_calls, + false, + "Non-ultra GPT-5.6 effort tiers have no delegation dependency — must stay forced off" + ); +}); From 9daf233a59b6da51b0cbc488990ca92dc3d4a20d Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Tue, 21 Jul 2026 08:35:49 -0300 Subject: [PATCH 2/2] =?UTF-8?q?fix(codex):=20drop=20over-broad=20parallel?= =?UTF-8?q?=5Ftool=5Fcalls=20allowlist=20entry=20=E2=80=94=20keep=20#2608?= =?UTF-8?q?=20stripping=20intact=20(#7821)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The static RESPONSES_API_ALLOWLIST addition made parallel_tool_calls survive for ALL models, breaking the #2608 non-passthrough stripping guarantee for gpt-5.5. The real #7821 fix (isCodexDelegationDependentModel gating in enforceCodexResponsesLiteParallelToolCalls) is model/effort-scoped and does not need the allowlist entry — native Codex traffic returns before the allowlist runs. --- open-sse/executors/codex.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/open-sse/executors/codex.ts b/open-sse/executors/codex.ts index ad7b31d1efde..74daed806440 100644 --- a/open-sse/executors/codex.ts +++ b/open-sse/executors/codex.ts @@ -1513,10 +1513,6 @@ export class CodexExecutor extends BaseExecutor { "client_metadata", // GPT-5 output verbosity ({ verbosity } — normalized above by normalizeCodexVerbosity). "text", - // Preserve Responses Lite delegation state (#7821) on the Chat-Completions-translated - // (non-native) path so it isn't dropped a second time after enforceCodexResponsesLite... - // already decided whether to keep or strip it. - "parallel_tool_calls", // Internal markers used by OmniRoute pipeline "_omnirouteResponsesStore", ]);