Skip to content

codex-tools: extract configured tool specs#16129

Merged
bolinfest merged 1 commit intomainfrom
pr16129
Mar 28, 2026
Merged

codex-tools: extract configured tool specs#16129
bolinfest merged 1 commit intomainfrom
pr16129

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Mar 28, 2026

Why

This continues the codex-tools migration by moving another passive tool-spec layer out of codex-core.

After ToolSpec moved into codex-tools, codex-core still owned ConfiguredToolSpec and create_tools_json_for_responses_api(). Both are data-model and serialization helpers rather than runtime orchestration, so keeping them in core/src/tools/registry.rs and core/src/tools/spec.rs left passive tool-definition code coupled to codex-core longer than necessary.

What changed

  • moved ConfiguredToolSpec into codex-rs/tools/src/tool_spec.rs
  • moved create_tools_json_for_responses_api() into codex-rs/tools/src/tool_spec.rs
  • re-exported the new surface from codex-rs/tools/src/lib.rs, which remains exports-only
  • updated core/src/client.rs, core/src/tools/registry.rs, and core/src/tools/router.rs to consume the extracted types and serializer from codex-tools
  • moved the tool-list serialization test into codex-rs/tools/src/tool_spec_tests.rs
  • added focused unit coverage for ConfiguredToolSpec::name()
  • simplified core/src/tools/spec_tests.rs to use the extracted ConfiguredToolSpec::name() directly and removed the now-redundant local tool_name() helper
  • updated codex-rs/tools/README.md so the crate boundary reflects the newly extracted tool-spec wrapper and serialization helper

Test plan

  • cargo test -p codex-tools
  • CARGO_TARGET_DIR=/tmp/codex-core-configured-spec cargo test -p codex-core --lib tools::spec::
  • CARGO_TARGET_DIR=/tmp/codex-core-configured-spec cargo test -p codex-core --lib client::
  • just fix -p codex-tools -p codex-core
  • just argument-comment-lint

References

@bolinfest bolinfest merged commit 4e27a87 into main Mar 28, 2026
22 checks passed
@bolinfest bolinfest deleted the pr16129 branch March 28, 2026 21:24
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

1 participant