mirror of
https://github.com/openai/codex.git
synced 2026-11-01 19:33:35 +00:00
## What changed - Add `prepare_elastic_entries` to cap required and optional supporting text before allocating whole optional entries. Measure rendered content, including JSON escaping, metadata, and framing, while preserving truncation markers. - Keep exact planned-action JSON, images, audio, and opaque native payloads whole. Mark shortened sources incomplete and record truncation sizes. - Expose token estimation and synchronous delivery preparation on `PreparedElasticContext` so deduplication uses the capped representations. ## Testing Add tests for required and optional entry caps, transcript metadata preservation, unchanged short entries and opaque payloads, and exact action preservation with rejection when the request budget cannot accommodate the action. GitOrigin-RevId: 23008fb03d15d501e5d602f0584f70b473c2c2e8