Skip to content

[codex] Move tool specs into core handlers#21416

Merged
pakrym-oai merged 1 commit into
mainfrom
pakrym/tool-handler-specs-pr1
May 6, 2026
Merged

[codex] Move tool specs into core handlers#21416
pakrym-oai merged 1 commit into
mainfrom
pakrym/tool-handler-specs-pr1

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

@pakrym-oai pakrym-oai commented May 6, 2026

Why

This is the first mechanical slice of moving tool spec ownership toward the handlers. codex-tools should keep shared primitives and conversion helpers, while builtin tool specs and registration planning live in codex-core with 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

  • Moved builtin tool spec constructors from codex-rs/tools/src into codex-rs/core/src/tools/handlers/*_spec.rs or nearby core tool modules.
  • Moved the registry planning code into codex-rs/core/src/tools/spec_plan.rs and its associated types/tests into core.
  • Kept shared primitives in codex-tools, including ToolSpec, schema/types, discovery/config primitives, dynamic/MCP conversion helpers, and code-mode collection helpers.
  • Updated handlers that referenced moved argument types or tool-name constants to use the core spec modules.
  • Moved spec tests next to the moved spec modules.

Verification

  • cargo check -p codex-tools
  • cargo check -p codex-core
  • cargo test -p codex-tools
  • cargo test -p codex-core _spec::tests
  • cargo test -p codex-core tools::spec_plan::tests
  • just fix -p codex-tools
  • just fix -p codex-core

Note: 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 in tools::handlers::multi_agents::tests::tool_handlers_cascade_close_and_resume_and_keep_explicitly_closed_subtrees_closed, which is outside this spec relocation.

@pakrym-oai pakrym-oai marked this pull request as ready for review May 6, 2026 22:02
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 6, 2026 22:02
@pakrym-oai pakrym-oai merged commit 9417cf9 into main May 6, 2026
36 of 38 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/tool-handler-specs-pr1 branch May 6, 2026 22:40
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 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