mirror of
https://github.com/openai/codex.git
synced 2026-12-01 00:20:48 +00:00
## Why A recovery turn can occupy the core turn slot before `TurnStarted` is published and thread statuses reflect it. During this window, `thread/resume` with configuration overrides could treat an unsubscribed thread as idle and shut it down, interrupting recovery. ## What changed Require the core turn slot to be empty before replacing a loaded thread during resume. Expose `CodexThread::has_active_turn()` and reuse it in the residency unload check. ## Testing Add a regression test that blocks paginated history writes to hold a recovery turn before status publication, reconnects with a configuration override, and verifies that the client receives completion for the preserved recovery turn. GitOrigin-RevId: f295038c8502a9b2849ddc08614db4a3cb5610cf