[codex] Use tool search for MCP tools by default - #29486
Merged
Merged
Conversation
rka-oai
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
MCP tools were only placed behind
tool_searchwhen a feature flag was enabled or when there were at least 100 tools. That made the model's tool flow depend on both rollout configuration and the number of installed tools.The searched-tool flow is now the intended behavior. Making it unconditional when the model and provider support it gives every supported setup the same behavior and lets us retire the feature flag safely.
What changed
tool_searchand namespaced tools are supported.tool_search_always_defer_mcp_toolsas removed and ignore old configured values.Why many tests changed
Many tests used to act as if the model could see MCP tools in its first request and call them immediately. That is no longer the real flow: the model first receives
tool_search, searches for a tool, receives the matching MCP tool, and then calls it in the next request.The tests therefore needed an extra search step, and checks for tool names, descriptions, and input fields had to move from the first request to the search result. These are not separate product changes; they make the tests follow what the model will actually see after this change. The plugin tests still check which tools are allowed and where they came from, the file tests still check upload fields and behavior, and the MCP round-trip test still checks a successful call from start to finish.
Tests
just test -p codex-featurescodex-coretests for MCP exposure and tool planningjust test -p codex-core explicit_plugin_mentionsjust test -p codex-core stdio_server_round_tripcodex-coretests for tool search, app-only tools, and MCP file uploads