Skip to content

Extract tool-search output helpers into codex-tools#16497

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

Extract tool-search output helpers into codex-tools#16497
bolinfest merged 1 commit intomainfrom
pr16497

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 2, 2026

Why

This is the next straight-refactor step in the codex-tools migration that follows #16493.

codex-rs/core still owned a chunk of pure tool-discovery metadata and response shaping even though the corresponding tool_search / tool_suggest specs already live in codex-rs/tools. Per the guidance in AGENTS.md, this moves that crate-agnostic logic out of codex-core so the handler crate keeps only the BM25 ranking/orchestration and runtime glue.

What changed

  • Moved the canonical tool_search / tool_suggest tool names and the tool_search default limit into codex-rs/tools/src/tool_discovery.rs.
  • Added ToolSearchResultSource and collect_tool_search_output_tools() in codex-tools so namespace grouping and deferred Responses API tool serialization happen outside codex-core.
  • Rewired ToolSearchHandler, ToolSuggestHandler, and core/src/tools/spec.rs to consume those exports directly from codex-tools.
  • Ported the existing tool_search serializer tests from core/src/tools/handlers/tool_search_tests.rs to tools/src/tool_discovery_tests.rs without adding new behavior coverage.

Validation

cargo test -p codex-tools
cargo test -p codex-core tools::spec::tests
just argument-comment-lint

@bolinfest bolinfest merged commit 0b856a4 into main Apr 2, 2026
50 of 52 checks passed
@bolinfest bolinfest deleted the pr16497 branch April 2, 2026 03:16
@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