mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
## Why Callers need to interrupt a specific active turn without discarding queued input. Tool callbacks must be able to await the interruption decision without blocking task cancellation. ## What changed - Add `CodexThread::interrupt_if_no_pending_input` and `Op::InterruptIfNoPendingInput`. - Check the turn identity and pending user input or mailbox items before taking the active task. Leave the turn running for stale or abandoned requests. - Acknowledge the decision before joining cancellation, and unblock pending submissions when the active task is cancelled. ## Testing Add regression coverage for successful interruption, stale turns, preservation of queued user input and agent mail, abandoned requests, and cancellation while the submission queue is full. GitOrigin-RevId: 42e31c09369fb070ba1b4b3c64ef45334dd872d8