mirror of
https://github.com/openai/codex.git
synced 2026-10-18 17:18:52 +00:00
## Why Manual, pre-turn, and post-turn compaction previously deferred rebuilding initial context until the next turn. Their saved replacement history could omit refreshed instructions and skill catalogs. ## What changed - Install initial context during local and remote compaction, before the last real user message or summary, keeping the compaction summary last. - Persist matching full world-state and turn-context baselines with every replacement instead of retaining only partial extension metadata. - Build replacement context and recompute token usage for the current model even when the previous model performs compaction. Reuse that captured context for eligible current-model retries. - Capture manual compaction context centrally and propagate preparation errors to the task runner. ## Testing Update assertions and snapshots for context ordering, refreshed instructions, resume and fork history, current-model checkpoint baselines, and cloud skill catalog retention across compaction and resume. GitOrigin-RevId: 8572a76c31c6884a3c580b3bbb350d49af876bd1