mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
## Why Process lifecycle handlers could overwrite each other's updates by reading and replacing the entire state. For example, a rejected stdin write could restore an older snapshot after the output collector recorded an exit code. ## What changed Apply lifecycle transitions in place under the watch channel's write lock. Rejected stdin writes and confirmed termination only mark the process as exited, preserving any exit code already reported by the executor. ## Testing Regression tests cover both closed stdin and unknown-process responses. They verify that subsequent lifecycle updates preserve the exit code and sandbox denial recovered from the final read, and that repeated calls to `fail_and_terminate` preserve the first failure message. GitOrigin-RevId: f090c0860c86b6e668c31d122d986ea4f4a119b6