Files
codex/codex-rs/tools/src
Owen Lin ea3c4848d8 Share MCP tool specs until search results are selected (#45509)
## Why

Building MCP search entries eagerly cloned tool specs and normalized schemas even for tools that were never selected.

## What changed

Store search specs in `Arc<ToolSpec>` and let MCP search entries share the handler's spec. Materialize and normalize loadable specs only for selected results, preserving existing result formatting and dynamic-tool cache equality behavior.

## Testing

Add coverage for function, freeform, and namespace specs that verifies shared specs produce equivalent results, retain the source while needed, and release it when the search entry is dropped.

GitOrigin-RevId: 4260f2e2527834d8a856b1528654c6951aab8a7d
2026-09-14 20:20:29 +00:00
..