CheckpointReactor ran the git status refresh on the same worker as checkpoint capture, and before it. That refresh ends in a remote PR lookup under the vcs status write lock. A fast follow-up message could edit files before the capture committed, so the checkpoint recorded the wrong tree.
The refresh now runs on its own drainable worker (statusRefreshWorker). Turn completion enqueues the refresh and moves straight to capture, so capture never waits behind the network call and checkpoints for other threads do not queue behind it either. drain waits on both workers. One test pins the behavior: the PR refresh blocks on a Deferred that stays open until the checkpoint.diff.finalized receipt lands and the ref contains the edited file.
Extracted from #10297.
Written by Claude Fable 5.1 in Claude Code.
Note
Decouple local git status refresh from checkpoint capture in CheckpointReactor#
- Completion events in CheckpointReactor.ts now enqueue status refresh work on a separate drainable worker instead of awaiting it inline, so checkpoint processing can proceed while the refresh is pending
- The reactor drain operation now waits for both the main worker and the new status-refresh worker
- Non-interruption failures in the status-refresh worker are logged and swallowed; only interruption causes propagate
- Adds test coverage in CheckpointReactor.test.ts for capturing a turn's checkpoint while pull-request status lookup is still pending
- Behavioral Change:
CheckpointReactor.make drain now blocks on queued status refreshes; callers relying on drain completing without pending refresh work will see different timing
Macroscope summarized 5d98a6c.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes