mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
## Why On Unix, a caller that stops draining an output pipe can stall `codex exec` in a write, preventing it from interrupting the turn and cleaning up running commands. ## What changed Move human-readable output, JSON events, and `--output-last-message` writes to a dedicated thread for local Unix runs. Handle `SIGTERM` alongside `SIGINT`, and bound the time spent waiting for output after an interrupt. Allow local turn cancellation before the server marks the turn active, and exit with status 1 if output is cut short. ## Testing Add regression tests that send `SIGTERM` with JSON stdout or human stderr blocked and check that the running command and its child exit. Also cover interruption while writing the last message to a blocked pipe. GitOrigin-RevId: fd9a3621d340cefc9af589c605596d2b178aaa9f