mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
## Why A turn interrupt can arrive while a command is waiting for its executor connection or while a newly launched shell is still being registered. The command can then launch after the interrupt or keep running before the caller has a session ID to interact with it. ## What changed Check for cancellation before dispatching a resumable command, including after remote connection recovery. If the shell has already started and is still running, stop it when cancellation wins before registration and return the usual `aborted by user` result. Preserve the result of commands that already reported an exit. Track any pending command begin and end events for interrupted startups so session shutdown waits for them to be published. ## Testing Add regression coverage for interrupts before dispatch and after launch but before registration, including command history on shutdown. Cover cancellation during remote executor recovery and cleanup of abandoned remote starts. GitOrigin-RevId: 624df736ca2cb077e879f52a194ee4d89afd225a