mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
## Why Separate reads and writes of the exit flag and exit code could let unified exec observe a process as exited before seeing its exit code, or return a live session ID alongside an exit code. ## What changed Store the exit code in a shared `OnceLock` for pipe, PTY, and driver-backed processes. Derive `has_exited()` from the presence of that code. Unified exec reads the code when it retires the session, after any pending output it needs to retain has been drained. ## Testing Extend the pipe, PTY, and driver-backed tests to check that the process handle exposes the exit code reported by the exit notification. The driver-backed test also verifies that output arriving after the notification is still collected. GitOrigin-RevId: 6192e5ceb9c71c6321e76f750c531c0ea6554dca