mirror of
https://github.com/openai/codex.git
synced 2026-08-24 13:20:07 +00:00
## Why When MCP tools are deferred behind `tool_search`, Code mode keeps them callable but omits their individual declarations from the initial `exec` description. The shared MCP `CallToolResult` types were derived only from directly rendered tools, so deferring every MCP tool also removed the common response contract that models need to interpret MCP results. This restores that contract without undoing the context savings from deferred tool definitions. This is a follow-up to #29486. ## What changed - Track deferred Code-mode tool definitions separately from directly rendered definitions. - Render the shared MCP type preamble when either direct or deferred MCP tools are available. - Keep deferred tool declarations out of the initial prompt. - Add unit and integration coverage for deferred MCP tools. ## Testing - `just test -p codex-code-mode-protocol` - `just test -p codex-core code_mode_only_guides_all_tools_search_and_calls_deferred_app_tools`