Repository navigation
Reap sandbox processes left in an exited harness session - #55
Merged
Merged
Conversation
Codex starts its filesystem-helper sandbox in a separate process group inside the app-server session. bwrap 0.9.0 arms PR_SET_PDEATHSIG only after the child reads its start eventfd, so a launcher killed between clone and that write strands the child forever. The stop check only probed the process group and reported such runs as stopped. Closing and stop confirmation now also find live members of the exited leader's session and SIGKILL them. A member that started no later than the recorded leader exit proves the session id was not reused, and each pid is re-read before the signal. Confirmation returns process-session-active while members remain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LikC1606
added a commit
that referenced
this pull request
Nov 28, 2026
…sions (#56) Since #54 a batch of same-file declarations shares one verification deadline. When the batch timed out, every attribution was blocked and the check rejected the first declaration instead of retrying in isolation. In continuation seeding, tryBatch rethrew that error and aborted the seed. A batch that only hit its deadline, or that reached a verification checkpoint, now falls back to per-declaration checks with their own deadlines. tryBatch also falls back on other batch check failures, so each candidate records its own result as before batching. Since #55, a child first tracked after it had exited got the current uptime as its exit tick. A later session that reused its pid as sid could then pass the continuity check and be SIGKILLed. Only an exit observed while tracked now bounds the session, and the detached proof-environment helper is tracked at spawn. Co-authored-by: Zhenhao Liu <176368005+LikC1606@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Five bwrap processes were left running on the host after harness sessions ended. They were Codex filesystem-helper sandboxes. Codex starts them in a separate process group inside the app-server session. bwrap 0.9.0 sets PR_SET_PDEATHSIG only after the child reads its start eventfd. If the launcher is killed between clone and that write, the child waits forever. The child is pid 1 of its own PID namespace, so only SIGKILL stops it. TheoremOS confirmed a stop by probing only the process group, so it reported these runs as stopped.
When closing a session and when confirming that it stopped, TheoremOS now also looks for live processes left in the exited leader's session and kills them with SIGKILL. Before killing, it checks that the session id was not reused: at least one member must have started no later than the recorded leader exit. Each pid is checked again right before the signal. Codex, Claude Code, OpenCode and CLI sessions record the exit time at spawn. While such processes remain, confirmation returns the new reason
process-session-active.Codex solo research still runs without a PID namespace. Forcing
isolateProcessthere would change its filesystem view, and the session sweep already covers this path.Testing
tsc --noEmitand the headless bundle build pass.Running campaigns use frozen build manifests and pick this up only after a release.
🤖 Generated with Claude Code