mirror of
https://github.com/openai/codex.git
synced 2026-09-10 20:26:47 +00:00
## Why Rebuilding a truncated message from its content fields can drop passthrough metadata and leave positional content classifications out of sync with the items that remain. ## What changed - Convert message content and its classifications into `AnnotatedContent` before applying the token budget, then write both back together. - Preserve other message and envelope metadata during truncation. - Assign the `unknown` classification to content from legacy messages that do not provide classifications. ## Testing Expanded truncation coverage to verify that retained text and image items keep their matching classifications and that unrelated passthrough metadata is preserved. GitOrigin-RevId: f84e2ebc3e97392e45f321dec3c171713864bdcd