Conversation
5e894bf to
118628e
Compare
starr-openai
approved these changes
Apr 22, 2026
c81782e to
b03f9f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A Mac Bazel run hit a flake in
server::handler::tests::output_and_exit_are_retained_after_notification_receiver_closeswhere the read path observed process exit but lost the expected buffered stdout (first\nsecond\n). See the GitHub Actions job and BuildBuddy invocation.The underlying race is that process exit is not the same thing as stdout/stderr closure. If a child or grandchild inherits the pipe write end, or a process duplicates it with
dup2, the watched process can exit while the stream is still open and more output can still arrive. The exec-server was starting exited-process retention cleanup from the exit event, so the process entry could be removed before the output streams had actually closed.While stress-testing the exec-server unit suite,
server::handler::tests::long_poll_read_fails_after_session_resumeexposed a separate test race: it started a short-lived command that could exit and wake the pending long-poll read before the session-resume assertion observed the resumed-session error. That test is intended to cover resume eviction, not process-exit delivery, so this change keeps the process alive and quiet while the second connection resumes the session.What changed
local_processunit coverage that proves late output is still retained after the short test retention interval has elapsed, and that closed process entries are eventually evicted.codex-rs/exec-server/src/server/handler/tests.rs, makelong_poll_read_fails_after_session_resumerun a long-lived silent command instead of a short command that prints and exits. This isolates the test to session-resume behavior and prevents a normal process exit from satisfying the pending long-poll read first.Testing
cargo test -p codex-exec-server exec_process_retains_output_after_exit_until_streams_closecargo test -p codex-exec-server local_process::testscargo test -p codex-exec-serverjust fix -p codex-exec-serverbazel test //codex-rs/exec-server:exec-server-unit-tests //codex-rs/exec-server:exec-server-exec_process-test //codex-rs/exec-server:exec-server-file_system-test //codex-rs/exec-server:exec-server-http_client-test //codex-rs/exec-server:exec-server-initialize-test //codex-rs/exec-server:exec-server-process-test //codex-rs/exec-server:exec-server-websocket-testbazel test --runs_per_test=25 //codex-rs/exec-server:exec-server-unit-testsDocumentation
No docs update needed; this is an internal exec-server correctness fix.