mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
## Why `codex exec` recovers turn items at completion because item notifications can be dropped under backpressure. This recovery needs to respect the thread's history mode. ## What changed For paginated threads, fetch every page from `thread/items/list`, scoped to the completed turn. Preserve items already present in the completion notification when merging the recovered history, and stop recovery if a cursor repeats. Keep `thread/read` recovery for other history modes. ## Testing Add regression coverage for recovering a final answer across multiple item pages and for a failed fork recovering only its own turn. GitOrigin-RevId: f005ca2cf9d8313bbbf32ed4c228ebb5e51428a2