Michael Bolin
0b856a4757
Extract tool-search output helpers into codex-tools ( #16497 )
...
## 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
```shell
cargo test -p codex-tools
cargo test -p codex-core tools::spec::tests
just argument-comment-lint
```
2026-04-01 20:16:21 -07:00
..
2026-03-31 13:06:08 +02:00
2026-03-25 12:26:02 -07:00
2026-03-27 19:00:44 -07:00
2026-04-01 19:03:26 -07:00
2026-03-27 19:00:44 -07:00
2026-03-27 19:00:44 -07:00
2026-04-01 15:42:18 -07:00
2026-03-25 12:57:42 -07:00
2026-03-27 19:00:44 -07:00
2026-04-01 15:30:10 -07:00
2026-03-30 10:48:49 -07:00
2026-04-01 11:03:48 -04:00
2026-03-24 18:34:44 -07:00
2026-03-27 15:45:19 +01:00
2026-04-01 11:03:48 -04:00
2026-04-01 20:16:21 -07:00
2026-03-27 19:00:44 -07:00
2026-03-24 18:10:53 -07:00
2026-03-14 15:38:51 -07:00
2026-03-26 13:34:02 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-20 21:13:20 +00:00
2026-03-20 21:13:20 +00:00
2026-03-31 01:37:27 -07:00
2026-03-27 19:00:44 -07:00
2026-04-01 19:15:15 -07:00
2026-03-27 19:00:44 -07:00
2026-03-31 01:37:27 -07:00
2026-04-01 15:42:18 -07:00
2026-04-01 15:42:18 -07:00
2026-03-27 19:00:44 -07:00
2026-04-01 19:03:26 -07:00
2026-03-31 11:22:38 +02:00
2026-04-01 19:03:26 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-27 19:00:44 -07:00
2026-03-12 08:16:36 -07:00
2026-03-19 10:53:08 -07:00
2026-03-27 19:00:44 -07:00
2026-03-24 15:45:40 -07:00
2026-03-27 19:00:44 -07:00
2026-04-01 19:03:26 -07:00
2026-03-12 00:35:21 -07:00
2026-03-27 19:00:44 -07:00
2026-03-25 10:43:49 -07:00
2026-03-19 18:58:17 -07:00
2026-03-27 19:00:44 -07:00
2026-03-27 06:17:59 +00:00
2026-03-27 14:25:13 -07:00
2026-03-27 14:25:13 -07:00
2026-03-27 19:00:44 -07:00
2026-03-24 12:43:53 -07:00
2026-03-27 19:00:44 -07:00
2026-03-12 08:16:36 -07:00
2026-03-27 19:00:44 -07:00
2026-03-21 01:28:25 +00:00
2026-03-27 19:00:44 -07:00
2026-04-01 11:03:48 -04:00
2026-03-27 19:00:44 -07:00
2026-03-16 16:48:15 -07:00
2026-03-27 19:00:44 -07:00
2026-03-24 11:04:47 -07:00
2026-03-27 19:00:44 -07:00
2026-03-25 19:18:03 -07:00
2026-03-25 23:51:39 -07:00
2026-04-01 19:03:26 -07:00
2026-04-01 19:03:26 -07:00
2026-03-27 19:00:44 -07:00
2026-03-27 19:00:44 -07:00
2026-03-27 15:22:04 -07:00
2026-04-01 19:03:26 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-25 11:05:35 -07:00
2026-03-27 19:00:44 -07:00
2026-03-18 11:54:11 -06:00
2026-04-01 15:30:10 -07:00
2026-03-31 01:37:27 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-27 19:00:44 -07:00
2026-03-27 06:17:59 +00:00
2026-04-01 13:21:50 -07:00
2026-03-19 20:12:07 -07:00
2026-03-20 18:23:48 +00:00
2026-03-16 16:48:15 -07:00
2026-03-27 19:00:44 -07:00
2026-03-25 16:02:22 +00:00
2026-03-31 01:37:27 -07:00
2026-03-27 19:00:44 -07:00
2026-03-24 15:45:40 -07:00
2026-03-16 21:38:07 -07:00
2026-03-31 01:37:27 -07:00
2026-03-14 15:38:51 -07:00
2026-03-16 16:48:15 -07:00
2026-03-27 14:50:01 +01:00
2026-03-24 18:10:53 -07:00
2026-03-26 16:06:53 -04:00
2026-03-24 08:20:57 -07:00
2026-03-27 19:00:44 -07:00
2026-03-24 08:20:57 -07:00
2026-03-26 17:12:45 -07:00
2026-03-20 18:23:48 +00:00
2026-03-24 18:10:53 -07:00
2026-03-17 10:07:46 -07:00
2026-03-30 11:59:50 -07:00
2026-03-17 17:59:27 +00:00
2026-03-27 19:00:44 -07:00
2026-03-16 16:48:15 -07:00
2026-03-27 19:00:44 -07:00
2026-03-25 12:57:42 -07:00
2026-03-07 02:30:21 +00:00
2026-03-24 18:10:53 -07:00
2026-03-27 19:00:44 -07:00
2026-03-19 22:57:16 -07:00
2026-03-25 16:14:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-27 19:00:44 -07:00
2026-03-25 16:14:36 -07:00
2026-03-31 14:10:43 +02:00
2026-03-31 14:10:43 +02:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-19 22:05:13 +00:00
2026-03-24 13:26:23 -07:00
2026-03-18 10:03:38 +00:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-27 19:00:44 -07:00
2026-03-19 18:58:17 -07:00
2026-03-12 08:16:36 -07:00
2026-03-12 08:16:36 -07:00
2026-03-27 19:00:44 -07:00
2026-03-26 17:27:38 -07:00