Skip to content

codex-tools: extract discovery tool specs#16193

Merged
bolinfest merged 1 commit intomainfrom
pr16193
Mar 30, 2026
Merged

codex-tools: extract discovery tool specs#16193
bolinfest merged 1 commit intomainfrom
pr16193

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Mar 29, 2026

Why

core/src/tools/spec.rs still owned the pure tool_search and tool_suggest spec builders even though that logic no longer needed codex-core runtime state. This change continues the codex-tools migration by moving the reusable discovery and suggestion spec construction out of codex-core so spec.rs is left with the core-owned policy decisions about when these tools are exposed and what metadata is available.

What changed

  • Added codex-rs/tools/src/tool_discovery.rs with the shared tool_search and tool_suggest spec builders, plus focused unit tests in tool_discovery_tests.rs.
  • Moved the shared DiscoverableToolAction and DiscoverableToolType declarations into codex-tools so the tool_suggest handler and the extracted spec builders use the same wire-model enums.
  • Updated core/src/tools/spec.rs to translate ToolInfo and DiscoverableTool values into neutral codex-tools inputs and delegate the actual spec building there.
  • Removed the old template-based description rendering helpers from core/src/tools/spec.rs and deleted the now-dead helper methods in core/src/tools/discoverable.rs.
  • Updated codex-rs/tools/README.md to document that discovery and suggestion models/spec builders now live in codex-tools.

Test plan

  • cargo test -p codex-tools
  • CARGO_TARGET_DIR=/tmp/codex-core-discovery-specs cargo test -p codex-core --lib tools::spec::
  • CARGO_TARGET_DIR=/tmp/codex-core-discovery-specs cargo test -p codex-core --lib tools::handlers::tool_suggest::
  • just argument-comment-lint

References

@bolinfest bolinfest changed the base branch from main to pr16154 March 29, 2026 21:22
Base automatically changed from pr16154 to main March 29, 2026 21:34
@bolinfest bolinfest merged commit 716f7b0 into main Mar 30, 2026
28 of 30 checks passed
@bolinfest bolinfest deleted the pr16193 branch March 30, 2026 15:15
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 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