mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
## Why A compaction checkpoint can leave the turn's `TurnStarted` event outside the replay window. When `thread/resume` excludes turns, the app server can then miss the turn ID and omit the saved token usage update. ## What changed Fall back to the latest saved `TurnContext` in the active turn when that turn starts at a compaction checkpoint. Use its turn ID to replay the saved `thread/tokenUsage/updated` notification. ## Testing Extend cold resume tests to check the turn ID, total and last token counts, and context window after compaction. Cover a rollback that leaves the usage owner unknown and verify that replay is skipped. GitOrigin-RevId: 4ea4f5e7a561fbba00fbe6b063f632a23193bc5a