Skip to content

Extract tool discovery helpers into codex-tools#16477

Merged
bolinfest merged 1 commit intomainfrom
pr16477
Apr 1, 2026
Merged

Extract tool discovery helpers into codex-tools#16477
bolinfest merged 1 commit intomainfrom
pr16477

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 1, 2026

Why

Follow-up to #16379 and #16471.

codex-rs/core/src/tools/spec.rs still owned the pure discovery-shaping helpers that turn app metadata and discoverable tool metadata into the inputs used by tool_search and tool_suggest. Those helpers do not need codex-core runtime state, so keeping them in codex-core continued to blur the crate boundary this migration is trying to tighten.

This change keeps pushing spec-only logic behind the codex-tools API so codex-core can focus on wiring runtime handlers to the resulting tool definitions.

What Changed

  • Added collect_tool_search_app_infos and collect_tool_suggest_entries to codex-rs/tools/src/tool_discovery.rs.
  • Added a small ToolSearchAppSource adapter type in codex-tools so codex-core can pass app metadata into that shared helper logic without exposing ToolInfo across the crate boundary.
  • Re-exported the new discovery helpers from codex-rs/tools/src/lib.rs, which remains exports-only.
  • Updated codex-rs/core/src/tools/spec.rs to use those codex-tools helpers instead of maintaining local tool_search_app_infos and tool_suggest_entries functions.
  • Removed the now-redundant helper implementations from codex-core.

Testing

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

@bolinfest bolinfest merged commit 1b711a5 into main Apr 1, 2026
22 checks passed
@bolinfest bolinfest deleted the pr16477 branch April 1, 2026 21:41
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 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