Skip to content

codex-tools: extract tool spec models#16047

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

codex-tools: extract tool spec models#16047
bolinfest merged 1 commit intomainfrom
pr16047

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Mar 27, 2026

Why

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

After ResponsesApiTool and the lower-level schema adapters moved into codex-tools, core/src/client_common.rs was still owning ToolSpec and the web-search request wire types even though they are serialized data models rather than runtime orchestration. Keeping those types in codex-core makes the crate boundary look smaller than it really is and leaves non-runtime tool-shape code coupled to core.

What changed

  • moved ToolSpec, ResponsesApiWebSearchFilters, and ResponsesApiWebSearchUserLocation into codex-rs/tools/src/tool_spec.rs
  • added focused unit tests in codex-rs/tools/src/tool_spec_tests.rs for:
    • ToolSpec::name()
    • web-search config conversions
    • ToolSpec serialization for web_search and tool_search
  • kept codex-rs/tools/src/lib.rs exports-only by re-exporting the new module from lib.rs
  • reduced core/src/client_common.rs to a compatibility shim that re-exports the extracted tool-spec types for current core call sites
  • updated core/src/tools/spec_tests.rs to consume the extracted web-search types directly from codex-tools
  • updated codex-rs/tools/README.md so the crate contract reflects that codex-tools now owns the passive tool-spec request models in addition to the lower-level Responses API structs

Test plan

  • cargo test -p codex-tools
  • cargo test -p codex-core --lib tools::spec::
  • cargo test -p codex-core --lib client_common::
  • just fix -p codex-tools -p codex-core
  • just argument-comment-lint

References

@bolinfest bolinfest requested a review from aibrahim-oai March 28, 2026 20:09
@bolinfest bolinfest merged commit bc53d42 into main Mar 28, 2026
55 of 76 checks passed
@bolinfest bolinfest deleted the pr16047 branch March 28, 2026 20:37
@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