Files
codex/codex-rs
Felipe Coury 01cb497492 Size the transcript layout cache to the viewport (#64882)
## Why

On tall terminals, painting the transcript and measuring the preceding
screenful for pagination can exceed the fixed 64-entry cache. Hidden
reasoning entries in compact mode also take up cache slots, which can
force visible text to be laid out again on the next frame.

## What changed

Set the entry limit to twice the viewport height plus two, clamped to
64–512 entries, and trim the cache when the viewport shrinks. Keep the
existing byte budget and skip caching hidden reasoning in compact mode.

## Testing

Cover eviction after shrinking the viewport and verify that repeated
frames reuse visible layouts in an 88-row viewport with partial history
and 100 hidden reasoning entries.

GitOrigin-RevId: 194f39e3ad1eb72a223481c600e95463a5674fc4
2026-12-01 02:41:35 +00:00
..
…
…
…
…