Skip to content

[codex] Hide deferred tools from code mode prompt#23605

Merged
pakrym-oai merged 2 commits into
mainfrom
pakrym/full-ci-fix-code-mode-deferred-tool-prompt
May 20, 2026
Merged

[codex] Hide deferred tools from code mode prompt#23605
pakrym-oai merged 2 commits into
mainfrom
pakrym/full-ci-fix-code-mode-deferred-tool-prompt

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

Why

code_mode_only_guides_all_tools_search_and_calls_deferred_app_tools was failing because code-mode prompt generation used the same nested tool spec list for both the model-visible exec guide and the runtime ALL_TOOLS surface. That allowed deferred MCP/app tools, such as calendar_timezone_option_99, to leak into the exec description even though they should only be discoverable through ALL_TOOLS at runtime.

What changed

Split code-mode nested tool planning into two sets in core/src/tools/spec_plan.rs:

  • runtime nested tool specs still include deferred tools, so tools[...] and ALL_TOOLS can call them
  • exec prompt docs only render non-deferred tools, so deferred app tools stay out of the model-visible guide

Validation

  • cargo test -p codex-core --test all code_mode_only_guides_all_tools_search_and_calls_deferred_app_tools -- --nocapture
  • looped the same focused test 5 additional times with cargo test -q -p codex-core --test all code_mode_only_guides_all_tools_search_and_calls_deferred_app_tools

@pakrym-oai pakrym-oai merged commit a52c91d into main May 20, 2026
75 of 81 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/full-ci-fix-code-mode-deferred-tool-prompt branch May 20, 2026 15:09
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 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.

1 participant