Skip to content

Keep tool_search visible in code-mode-only sessions - #1

Open
yunusemregul wants to merge 1 commit into
mainfrom
fix/code-mode-nested-tool-discovery
Open

yunusemregul wants to merge 1 commit into
mainfrom
fix/code-mode-nested-tool-discovery

Conversation

@yunusemregul

Copy link
Copy Markdown
Owner

What

Keep tool_search on the direct model tool surface when code_mode_only is enabled, while leaving deferred MCP tools out of the initial prompt until they are discovered.

This adds planner coverage and a Responses Lite integration test that searches for a deferred MCP tool and then calls the returned namespace tool.

Why

In code-mode-only sessions, ordinary tools are removed from the top-level model surface unless they are explicitly direct-model-only. MCP tools may also be deferred to tool_search. Because the cached tool_search handler retained normal exposure, the code-mode-only filter removed the search bridge at the same time as the MCP tools were deferred. The server could initialize and complete tools/list, but the model had no callable path to reach the discovered tools.

Addresses openai#19425. Related reports: openai#14242 and openai#10499.

How

  • Override the cached tool_search handler exposure to DirectModelOnly.
  • Keep deferred MCP namespaces hidden from the initial request and from the nested code-mode executor surface.
  • Verify that Responses Lite advertises tool_search, receives the deferred MCP namespace from search, and successfully dispatches the namespace tool call.
  • Update code-mode-only tool expectations and isolate existing direct-namespace tests from unrelated collaboration tools.

Testing

  • just fmt
  • just fix -p codex-core
  • Targeted planner and integration tests for code-mode-only, deferred MCP search, MCP namespace calls, and existing direct-only namespace behavior
  • Manual app-server verification with a configured Streamable HTTP MCP server

A broad just test -p codex-core run was also attempted: 2,898 tests passed; most remaining failures required separately built test binaries (codex / test_stdio_server), with one unrelated timeout and one unrelated skill-budget failure.

Upstream submission status

This PR is hosted in the fork as a reviewable artifact. The upstream repository documents external code contributions as invitation-only, and both GitHub GraphQL and REST rejected creating a pull request against openai/codex. If a maintainer invites the contribution, this branch can be submitted directly upstream without modification.

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.

1 participant