Skip to content

fix(executors): disable parallel tools for Codex Responses Lite - #7171

Merged
diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.49from
fenix007:fix/codex-responses-lite-parallel-tools
Jul 19, 2026
Merged

diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.49from
fenix007:fix/codex-responses-lite-parallel-tools

Conversation

@fenix007

Copy link
Copy Markdown
Contributor

Summary

  • Detect the official Codex Responses Lite signal from the HTTP client header or the WebSocket client_metadata marker.
  • Force parallel_tool_calls: false before Codex HTTP or WebSocket execution without mutating the caller's request body.
  • Preserve existing behavior for non-Lite requests.

Related Issues

  • User-reported upstream error: X-OpenAI-Internal-Codex-Responses-Lite requires parallel_tool_calls to be false.

Validation

  • npm run lint
  • npm run test:unit (targeted Codex suite passes; the full local suite hit two unrelated bootstrapEnv failures on current main and was stopped)
  • npm run test:coverage
  • Coverage is still >= 60% for statements, lines, functions, and branches
  • SonarQube PR analysis is green or any remaining issues are explicitly documented below
  • npm run typecheck:core
  • Pre-commit checks run manually because the checked-out Husky scripts had CRLF line endings

Tests Added Or Updated

  • tests/unit/executor-codex-gpt56.test.ts
  • Verifies HTTP-header and WebSocket-metadata Lite markers, input immutability, and unchanged non-Lite behavior.
  • tests/unit/executor-codex.test.ts plus the updated GPT-5.6 test file: 44/44 passing.

Coverage Notes

  • The new execution branch is covered through the public CodexExecutor.execute path for both supported Lite markers and the non-Lite control case.
  • Coverage was not run locally; CI should report repository-wide thresholds.

Reviewer Notes

  • The fix is signal-scoped rather than model-scoped, so future Responses Lite models receive the same protection without disabling parallel tool calls for normal requests.
  • No migrations or feature flags.

@fenix007
fenix007 marked this pull request as ready for review July 14, 2026 16:51
@fenix007
fenix007 requested a review from diegosouzapw as a code owner July 14, 2026 16:51

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +156 to +172
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 };
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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];
      }
    }

Comment on lines +73 to +80
const metadataBody = {
_nativeCodexPassthrough: true,
model: "gpt-5.6-sol",
input: [],
client_metadata: {
ws_request_header_x_openai_internal_codex_responses_lite: "true",
},
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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",
    },
  };

@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.49 July 15, 2026 08:19
@diegosouzapw
diegosouzapw merged commit 1636a8e into diegosouzapw:release/v3.8.49 Jul 19, 2026
3 checks passed
@diegosouzapw

Copy link
Copy Markdown
Owner

Merged into release/v3.8.49 — thank you for the contribution, @fenix007! 🎉 Validated in today's full-suite merge-train (33 PRs, 19k+ tests green) before landing.

@diegosouzapw diegosouzapw mentioned this pull request Jul 23, 2026
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
…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>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants