fix(executors): disable parallel tools for Codex Responses Lite - #7171
diegosouzapw merged 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for Codex Responses Lite requests by detecting the lite marker (via HTTP headers or WebSocket metadata) and enforcing parallel_tool_calls: false. The review feedback correctly identifies that parallel_tool_calls will be stripped for non-passthrough (translated) requests because it is missing from the RESPONSES_API_ALLOWLIST. To address this, the reviewer suggests dynamically adding it to the allowlist when set to false and updating the unit tests to cover this non-passthrough path.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| function enforceCodexResponsesLiteParallelToolCalls( | ||
| bodyInput: unknown, | ||
| clientHeaders?: Record<string, string> | null | ||
| ): unknown { | ||
| if ( | ||
| !isCodexResponsesLiteRequest(bodyInput, clientHeaders) || | ||
| !bodyInput || | ||
| typeof bodyInput !== "object" || | ||
| Array.isArray(bodyInput) | ||
| ) { | ||
| return bodyInput; | ||
| } | ||
|
|
||
| const body = bodyInput as Record<string, unknown>; | ||
| if (body.parallel_tool_calls === false) return bodyInput; | ||
| return { ...body, parallel_tool_calls: false }; | ||
| } |
There was a problem hiding this comment.
Issue: parallel_tool_calls is stripped for non-passthrough (translated) requests
For requests where _nativeCodexPassthrough is false (or omitted), the request body goes through the allowlist filtering at the end of transformRequest (around line 1493):
for (const key of Object.keys(body)) {
if (!RESPONSES_API_ALLOWLIST.has(key)) {
delete body[key];
}
}Since parallel_tool_calls is not present in RESPONSES_API_ALLOWLIST, it will be silently stripped from the request body. This means translated Lite requests will still trigger the upstream error:
X-OpenAI-Internal-Codex-Responses-Lite requires parallel_tool_calls to be false.
The unit tests did not catch this because all test cases explicitly set _nativeCodexPassthrough: true, bypassing the allowlist filtering.
Suggested Fix
To fix this, we should dynamically allow parallel_tool_calls in RESPONSES_API_ALLOWLIST when it is set to false. Update transformRequest around line 1493 to dynamically add "parallel_tool_calls" to the allowlist if it is false:
if (body.parallel_tool_calls === false) {
RESPONSES_API_ALLOWLIST.add("parallel_tool_calls");
}
for (const key of Object.keys(body)) {
if (!RESPONSES_API_ALLOWLIST.has(key)) {
delete body[key];
}
}| const metadataBody = { | ||
| _nativeCodexPassthrough: true, | ||
| model: "gpt-5.6-sol", | ||
| input: [], | ||
| client_metadata: { | ||
| ws_request_header_x_openai_internal_codex_responses_lite: "true", | ||
| }, | ||
| }; |
There was a problem hiding this comment.
To ensure that the translated (non-passthrough) path is also covered and that parallel_tool_calls is not stripped during request translation, we should remove _nativeCodexPassthrough: true from the metadataBody test case.
const metadataBody = {
model: "gpt-5.6-sol",
input: [],
client_metadata: {
ws_request_header_x_openai_internal_codex_responses_lite: "true",
},
};|
Merged into |
…osouzapw#7171) * chore(ci): add .mergify.yml to main — Mergify only reads config from the default branch (diegosouzapw#7168) * fix(executors): disable parallel tools for Codex Responses Lite * docs(changelog): add Responses Lite fix fragment --------- Co-authored-by: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Co-authored-by: alexey.nazarov@softmg.ru <alexey.nazarov@softmg.ru>
…osouzapw#7171) * chore(ci): add .mergify.yml to main — Mergify only reads config from the default branch (diegosouzapw#7168) * fix(executors): disable parallel tools for Codex Responses Lite * docs(changelog): add Responses Lite fix fragment --------- Co-authored-by: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Co-authored-by: alexey.nazarov@softmg.ru <alexey.nazarov@softmg.ru>
Summary
client_metadatamarker.parallel_tool_calls: falsebefore Codex HTTP or WebSocket execution without mutating the caller's request body.Related Issues
X-OpenAI-Internal-Codex-Responses-Lite requires parallel_tool_calls to be false.Validation
npm run lintnpm run test:unit(targeted Codex suite passes; the full local suite hit two unrelatedbootstrapEnvfailures on currentmainand was stopped)npm run test:coverage>= 60%for statements, lines, functions, and branchesnpm run typecheck:coreTests Added Or Updated
tests/unit/executor-codex-gpt56.test.tstests/unit/executor-codex.test.tsplus the updated GPT-5.6 test file: 44/44 passing.Coverage Notes
CodexExecutor.executepath for both supported Lite markers and the non-Lite control case.Reviewer Notes