Files
codex/codex-rs/core/tests
Charlie Marsh 3ead673946 Defer extension tool history materialization until first access (#47035)
## Why

Extension tool calls eagerly copied and converted conversation history even when the tool never read it.

## What changed

Retain a shared invocation-time snapshot and defer conversion to raw response items until `ConversationHistory::items()` is called. Cache the result across clones with `LazyLock`, and keep debug formatting from triggering materialization. Release unrelated history metadata when capturing the shared items.

## Testing

Extend the extension executor test to verify that history first read after a later turn still reflects the invocation-time snapshot, in both legacy and paginated history modes. Update the history API test to check that shared items preserve their envelopes.

GitOrigin-RevId: c737b765b7e4889735dc78e12d685d36e854570b
2026-09-21 13:56:17 +00:00
..