Skip to content

fix(codex): preserve namespace MCP tools forwarded to Codex Responses… - #1483

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.7.0from
vanminhph:fix/codex-namespace-mcp-tools
Apr 21, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.7.0from
vanminhph:fix/codex-namespace-mcp-tools

Conversation

@vanminhph

Copy link
Copy Markdown
Contributor

… API

normalizeCodexTools() was dropping all tools with type !== "function", which stripped namespace-typed MCP tool groups (e.g. mcp__atlassian__) before the request reached the Codex API. Codex then saw an empty tools array and refused to call any MCP tools.

Fix: detect type === "namespace" entries, preserve them as-is (Codex API supports them natively), and register sub-tool names in validToolNames so tool_choice validation still works correctly. Also whitelist "namespace" in the openai-responses translator to prevent a throw on the same type when the translation path is invoked.

Summary

  • Describe the user-facing or operational change.

Related Issues

  • Closes #
  • Related to #

Validation

  • npm run lint
  • npm run test:unit
  • 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

Tests Added Or Updated

  • List every changed or added automated test file.
  • If no production code changed, state that here.

Coverage Notes

  • If this PR changes src/, open-sse/, electron/, or bin/, explain which tests cover the change.
  • If coverage moved down in any touched file, explain why and what follow-up task will recover it.

Reviewer Notes

  • Call out any risky areas, migrations, feature flags, or manual validation that reviewers should know about.

… API

normalizeCodexTools() was dropping all tools with type !== "function",
which stripped namespace-typed MCP tool groups (e.g. mcp__atlassian__)
before the request reached the Codex API. Codex then saw an empty tools
array and refused to call any MCP tools.

Fix: detect type === "namespace" entries, preserve them as-is (Codex API
supports them natively), and register sub-tool names in validToolNames so
tool_choice validation still works correctly. Also whitelist "namespace"
in the openai-responses translator to prevent a throw on the same type
when the translation path is invoked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vanminhph
vanminhph requested a review from diegosouzapw as a code owner April 21, 2026 15:38

@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 introduces support for 'namespace' tools, which represent MCP tool groups used by the Codex and OpenAI Responses API. The changes include updating the tool normalization logic to register sub-tool names for validation and adjusting the request translator to permit the 'namespace' tool type. I have no feedback to provide as there are no review comments.

@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.7.0 April 21, 2026 20:12
@diegosouzapw
diegosouzapw merged commit 9cd36af into diegosouzapw:release/v3.7.0 Apr 21, 2026
2 checks passed
This was referenced Apr 22, 2026
Poid-ZA pushed a commit to Poid-ZA/OmniRoute that referenced this pull request Aug 5, 2026
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
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