mirror of
https://github.com/openai/codex.git
synced 2026-12-04 00:51:02 +00:00
## Why Local compaction flattened retained user messages into a single text part, losing their original content boundaries and per-part annotations. ## What changed Preserve the original content parts and annotations for text-only user messages that fit within the token budget. Borrow the original messages until selected history entries are materialized, and rebuild only the text fallback for truncated messages or messages containing media. ## Testing Extend unit coverage for text boundaries, empty parts, omitted media, and retained metadata. Update the compaction integration test to verify that a multipart user message survives unchanged in the next request and retains its content parts and annotations in persisted replacement history. GitOrigin-RevId: 39d9df9ae5360506c2a4bdeac76d89198dbbd39c