Skip to content

Move tool registry plan tests into codex-tools#16521

Merged
bolinfest merged 1 commit intomainfrom
pr16521
Apr 2, 2026
Merged

Move tool registry plan tests into codex-tools#16521
bolinfest merged 1 commit intomainfrom
pr16521

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 2, 2026

Why

#16513 moved pure tool-registry planning into codex-tools, but much of the corresponding spec/feature-gating coverage still lived in codex-core. That leaves the tests for planner behavior in the crate that no longer owns that logic and makes the next extraction steps harder to review.

What

Move the planner-only spec_tests.rs coverage into codex-rs/tools/src/tool_registry_plan_tests.rs and wire it up from codex-rs/tools/src/tool_registry_plan.rs using the crate-local #[path = "tool_registry_plan_tests.rs"] mod tests; pattern.

The codex-core test file now keeps the core-side integration checks: router-visible model tool lists, namespaced handler alias registration, shell adapter behavior, and MCP schema edge cases that still exercise the core binding layer.

Verification

  • cargo test -p codex-tools
  • cargo test -p codex-core tools::spec::tests

@bolinfest bolinfest changed the base branch from main to pr16513 April 2, 2026 06:55
bolinfest added a commit that referenced this pull request Apr 2, 2026
## Why
This is a larger step in the `codex-core` -> `codex-tools` migration
called out in `AGENTS.md`.

`codex-rs/core/src/tools/spec.rs` had become mostly pure tool-spec
assembly plus handler registration. That made it hard to move more of
the tool-definition layer into `codex-tools`, because the runtime
binding and the crate-independent planning logic were still interleaved
in one function.

Splitting those concerns gives `codex-tools` ownership of the
declarative registry plan while keeping `codex-core` responsible for
instantiating concrete handlers.

## What Changed
- Add a `codex-tools` registry-plan layer in
`codex-rs/tools/src/tool_registry_plan.rs` and
`codex-rs/tools/src/tool_registry_plan_types.rs`.
- Move feature-gated tool-spec assembly, MCP/dynamic tool conversion,
tool-search aliases, and code-mode nested-plan expansion into
`codex-tools`.
- Keep `codex-rs/core/src/tools/spec.rs` as the core-side adapter that
maps each planned handler kind to concrete runtime handler instances.
- Update `spec_tests.rs` to import the moved `codex_tools` symbols
directly instead of relying on top-level `spec.rs` re-exports.

This is intended to be a straight refactor with no behavior change and
no new test surface.

## Verification
- `cargo test -p codex-tools`
- `cargo test -p codex-core tools::spec::tests`

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16513).
* #16521
* __->__ #16513
Base automatically changed from pr16513 to main April 2, 2026 07:18
@bolinfest
Copy link
Copy Markdown
Collaborator Author

@codex review

@bolinfest bolinfest merged commit 5131e0d into main Apr 2, 2026
36 of 44 checks passed
@bolinfest bolinfest deleted the pr16521 branch April 2, 2026 07:26
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 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