[codex] Move tool specs into core handlers#21416
Merged
Merged
Conversation
sayan-oai
approved these changes
May 6, 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
This is the first mechanical slice of moving tool spec ownership toward the handlers.
codex-toolsshould keep shared primitives and conversion helpers, while builtin tool specs and registration planning live incodex-corewith the handlers that own those tools.Keeping this PR to relocation and import updates isolates the copy/move review from the later logic change that wires specs through registered handlers.
What changed
codex-rs/tools/srcintocodex-rs/core/src/tools/handlers/*_spec.rsor nearby core tool modules.codex-rs/core/src/tools/spec_plan.rsand its associated types/tests into core.codex-tools, includingToolSpec, schema/types, discovery/config primitives, dynamic/MCP conversion helpers, and code-mode collection helpers.Verification
cargo check -p codex-toolscargo check -p codex-corecargo test -p codex-toolscargo test -p codex-core _spec::testscargo test -p codex-core tools::spec_plan::testsjust fix -p codex-toolsjust fix -p codex-coreNote: I also tried the broader
cargo test -p codex-core tools::; it reached the moved spec-plan/spec tests successfully, then aborted with a stack overflow intools::handlers::multi_agents::tests::tool_handlers_cascade_close_and_resume_and_keep_explicitly_closed_subtrees_closed, which is outside this spec relocation.