mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Fix turn interrupt reply ordering and shutdown handling (#62066)
## Why A delayed terminal event from an earlier turn could acknowledge interrupts for a later turn. Interrupts could also remain pending after the thread listener shut down. ## What changed - Associate pending `turn/interrupt` requests with their target turn and reply only when that turn completes or aborts. - Track the current Core turn through stop hooks and resolve review delegate IDs to the owning turn when validating interrupts. - Settle pending interrupts with an error on listener shutdown and reject further interrupts against the retired runtime. ## Testing Add regression tests for delayed terminal events, queued turn starts, review delegates, and interrupt handling during thread revert and runtime replacement. GitOrigin-RevId: 9695fc3f718baa6b792a14d54136bb87fc003100
This commit is contained in:
@@ -367,6 +367,7 @@ impl Session {
|
||||
}
|
||||
let turn = active.get_or_insert_with(ActiveTurn::default);
|
||||
debug_assert!(turn.task.is_none());
|
||||
turn.turn_id = Some(turn_context.sub_id.clone());
|
||||
turn.finishing = None;
|
||||
Arc::clone(&turn.turn_state)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user