Repository navigation
Close run-lifecycle races R1-R3, R5-R8 (#1430 Phase A) - #1609
Merged
currentbits merged 1 commit intoOct 12, 2026
Merged
Conversation
- R1: the orchestrator hop (pendingFork, /handoff etc.) holds a preparing entry; a second send bounces, notices queue, Stop lands and stops a worker that slipped past stopCrew. Notices never take the fork path. - R2: verify is an `active` entry; Stop kills the command, starts bounce, and only the owning gate writes status. - R3: await the checkpoint before finishSuccessfulTurn; drop the duplicate drain in notifyRunTerminal so the queued turn starts after the commit. - R5: a throw after the preparing entry is registered clears it. - R6: codexSessionHeld counts a preparing Codex launch. - R7: git:mergeWorktree / git:removeWorktree refuse a running thread. - R8: steerRun files no row when the run ended during the send. R4 and the Phase B transition lock are not included. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Phase A of #1430: targeted fixes with no lock. R4 and the Phase B transition lock are left for a follow-up.
/handoff-style dispatch) holds apreparingentry viaholdForHop. A second send gets "already active", worker notices queue and flush when the hop clears, and Stop lands. If Stop hits mid-hop, a worker that slipped paststopCrewis stopped, and dispatch starts no more workers. Notices never take the fork path.activeentry{kind:"verify"}. Stop kills the command through a newsignaloption onrunVerifyCommand, a start during verify is refused, andreleaseVerifygates every status write on still owning the entry.finishSuccessfulTurn. The duplicate drain at the end ofnotifyRunTerminalis removed, so the queued follow-up starts after the commit.preparing).codexSessionHeldcounts apreparingentry on a Codex thread.git:mergeWorktreeandgit:removeWorktreerefuse whilerunner.isRunning.steerRunthrows instead of filing the steer row when the run changed during the send.Behaviour notes
maxConcurrentRuns.workingstatus, so a crash-stale status can't block manual cleanup.Tests
There is one regression test per race in stop-during-prepare, orchestrator-threads, verify-gate, checkpoints, codex-writer-lock, orch-merge (R7) and codex (R8). All 10 fail on the pre-fix source.
runner.test.js's sweep test now waits for the post-checkpoint sweep.npm run test:electron(CI-like env, rebased on 3b650a5): 4664 pass, 6 fail. None of the failures come from this change:store.test.jsround-trip andautomation-create-mcpGitHub trigger also fail on main.Refs #1430
🤖 Generated with Claude Code