code-mode: carry nested tool kind through runtime#22377
Merged
Conversation
sayan-oai
approved these changes
May 12, 2026
…c' into pakrym/code-mode-remove-find-spec
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
Code mode only used nested spec lookup at execution time to rediscover whether a nested tool should be invoked as a function tool or a freeform tool.
That information is already present in the enabled tool metadata that code mode builds to expose
tools.*andALL_TOOLS, so re-looking it up from the router was redundant and kept execution coupled to a separate spec lookup path.What Changed
CodeModeToolKindthrough the code-mode runtimeToolCallevent andCodeModeNestedToolCallfind_specfind_specplumbing from the router and parallel runtime helpersTesting
cargo test -p codex-code-modecargo test -p codex-core code_mode::testscargo test -p codex-core extension_tool_bundles_are_model_visible_and_dispatchablecargo test -p codex-core model_visible_specs_filter_deferred_dynamic_tools