mirror of
https://github.com/openai/codex.git
synced 2026-08-31 14:28:48 +00:00
## Why Blocking PTY reads and output-channel sends can keep Tokio runtime shutdown waiting when a detached child retains the terminal or output backpressure fills the channel. ## What changed - Drive Unix PTY reads and writes through nonblocking `AsyncFd` readiness so their tasks can be cancelled during shutdown. - Keep draining child output after its receiver closes, and preserve queued input plus EOF delivery when portable PTY stdin closes. - Return a descriptive error when PTY spawning uses a Tokio runtime without an I/O driver. ## Testing Add Unix coverage for detached children, full and dropped output channels, large input with EOF, inherited file descriptors, and runtimes without I/O. GitOrigin-RevId: f7f1f58abebf8bf1d39285cd61b8d69946d54155