mirror of
https://github.com/openai/codex.git
synced 2026-09-28 08:43:01 +08:00
## Why Yield signals and queued runtime events can detach an observer during termination, before the remaining output has been drained. ## What changed Track the active yield signal separately from the observer so termination can disable yielding while keeping the observer attached. Ignore `Started`, `Pending`, and `YieldRequested` events during termination, allowing queued output to reach the observer in `CellEvent::Terminated`. ## Testing Extend the termination regression test with an immediate yield timeout, a canceled yield signal, and queued start, yield, output, and completion events. Assert that both the termination caller and the initial observer receive the queued output in the terminated event. GitOrigin-RevId: 1c08bdec06838123aaa102268da2f50b63ddea3f