Skip to content

[codex] Use tool search for MCP tools by default - #29486

Merged
sayan-oai merged 2 commits into
mainfrom
codex/always-defer-mcp-tools
Jun 22, 2026
Merged

[codex] Use tool search for MCP tools by default#29486
sayan-oai merged 2 commits into
mainfrom
codex/always-defer-mcp-tools

Conversation

@sayan-oai

Copy link
Copy Markdown
Contributor

Why

MCP tools were only placed behind tool_search when 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

  • Defer all effective MCP tools when tool_search and namespaced tools are supported.
  • Keep exposing MCP tools directly when search cannot be used, so older or unsupported model/provider combinations still work.
  • Mark tool_search_always_defer_mcp_tools as removed and ignore old configured values.
  • Keep plugin filtering, app-only filtering, file handling, and MCP calls working through the searched-tool flow.

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-features
  • Focused codex-core tests for MCP exposure and tool planning
  • just test -p codex-core explicit_plugin_mentions
  • just test -p codex-core stdio_server_round_trip
  • Focused codex-core tests for tool search, app-only tools, and MCP file uploads

@sayan-oai
sayan-oai requested a review from a team as a code owner June 22, 2026 21:43
@sayan-oai
sayan-oai merged commit c53b1da into main Jun 22, 2026
31 checks passed
@sayan-oai
sayan-oai deleted the codex/always-defer-mcp-tools branch June 22, 2026 23:45
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants