Repository navigation
fix: let the Codex session exit on stdin EOF before killing its tree - #905
Open
bandzalkin wants to merge 2 commits into
Open
bandzalkin wants to merge 2 commits into
bandzalkin wants to merge 2 commits into
Conversation
…s tree close() killed the child's session with SIGKILL before closing stdin, so Codex never saw the EOF it exits on and could do nothing at shutdown. Stdin now closes first and the session gets one second to end on its own; the tree kill remains the fallback. The session id stays reserved while any member lives, so a launcher shim's real CLI child that keeps the room directory is still reaped.
bandzalkin
added a commit
to bandzalkin/band-sdk-python
that referenced
this pull request
Oct 21, 2026
…s tree Source-Base: 5fe1704 Source-Head: 848129c Upstream-PR: band-ai#905
github-actions Bot
pushed a commit
to bandzalkin/band-sdk-python
that referenced
this pull request
Oct 21, 2026
…s tree Source-Base: 5fe1704 Source-Head: 848129c Upstream-PR: band-ai#905
github-actions Bot
pushed a commit
to bandzalkin/band-sdk-python
that referenced
this pull request
Oct 21, 2026
…s tree Source-Base: 5fe1704 Source-Head: 848129c Upstream-PR: band-ai#905
github-actions Bot
pushed a commit
to bandzalkin/band-sdk-python
that referenced
this pull request
Oct 21, 2026
…s tree Source-Base: 5fe1704 Source-Head: 848129c Upstream-PR: band-ai#905
bandzalkin
marked this pull request as ready for review
October 22, 2026 01:55
bandzalkin
requested review from
AlexanderZ-Band and
amit-gazal-band
as code owners
October 22, 2026 01:55
github-actions Bot
pushed a commit
to bandzalkin/band-sdk-python
that referenced
this pull request
Oct 22, 2026
…s tree Source-Base: 5fe1704 Source-Head: 848129c Upstream-PR: band-ai#905
bandzalkin
marked this pull request as draft
October 22, 2026 10:09
bandzalkin
marked this pull request as ready for review
October 22, 2026 10:35
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
CodexStdioClient.closekills the child's whole session withSIGKILLbefore closing stdin, so Codex never gets the EOF it exits on and nothing it does at shutdown (flushing state, ending the servers it started) can happen. A host that treats the harness's own shutdown as part of its contract, like band-agent's runner, which ends what the harness leaves behind, sees the harness vanish under it instead.What
Close stdin first and give every process in the child's session up to one second to exit; the tree kill stays as the fallback for a session that does not. The session id stays reserved while any member lives, so probing the group is exact: a launcher shim whose real CLI child keeps the room directory is still reaped (
test_close_reaps_a_worker_when_its_launcher_exits_on_stdin_eofnow pins that the launcher sees EOF and its worker is reaped). New test: a harness that exits on EOF ends with status 0, not-9.Scope
POSIX close path only; the Windows job-object path is unchanged.