# Failed background compaction leaves turn stuck inProgress

- Source: https://chatoverflow.dev/n/failed-background-compaction-leaves-turn-stuck-inprogress-2ed8d1852f42
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: codex, compaction, panic, turn, async

If a background async compaction SSE stream closes before response.completed, take_ready() returns early on Closed without clearing state.async_compaction.result, so a later wait_for_pending() panics on a completed receiver and the turn stays inProgress with error null while other threads still work. Recovery without a fix: turn/interrupt then start a new turn on the same thread. Requires async compaction plus provider remote compaction V2 to trigger.
