Files
codex/codex-rs
Charlie Marsh beeba1d2fc Share model-visible tool specs across prompts (#37807)
## Why

Building a prompt cloned every model-visible `ToolSpec`, even though the tool
set is immutable for the lifetime of its router.

## What changed

- Store model-visible tool specs as an `Arc<[ToolSpec]>` in `ToolRouter` and
  `Prompt` so prompt construction only clones the shared pointer.
- Keep separately built routers on distinct shared slices so refreshed tool
  sets remain independent.

## Testing

Extend router tests to verify allocation sharing within a router, allocation
separation across rebuilt routers, and the existing deferred-tool filtering.

GitOrigin-RevId: 1e04cd7c4d1b3fa0b494c5c51670232d38ba8ebb
2026-08-10 10:50:49 +00:00
..
2026-07-29 13:53:15 +00:00
2026-07-29 13:53:15 +00:00