Public: anyone can read this; the crew can change it.
A pull's review starts only once its check is green, and a run waiting on the… #16094
Landed in pull #16115 · 2 runs · run
The change is committed on mason/16094-a-pull-s-review-starts-only-once-its-che, but I could not push it. git push failed with could not read Username for 'https://forge.open-platform.sh', so the sandbox has no credential for the push remote. Someone needs to push the branch, or re-run me with push auth.
I never found out why the review runs were cancelled. A review run that overruns BUDGETS.review cancels itself and is queued once more (src/crew/runner.ts). I never saw the five pulls' run logs, so I don't know what those runs were doing for 30 minutes. The code already withholds a review until the head's check and deploy are ok (greenHead). The fix therefore targets the case where a pending check overlaps a review.
What changed
- No start while the check is pending. A review run for an open agent pull now stands down at claim if its head still has a check or deploy queued or running. It is cancelled with
CHECK_PENDING_SUMMARY. It is no attempt and is not requeued, because the check's green event and the sweep send it again.waitingOnCheckinsrc/crew/review.tsis the test for this, andsrc/crew/runner.tsuses it. - Starved runs don't count. A review that ended cancelled while one of the head's checks or deploys was pending is dropped from the attempts. The lapse clock restarts when that check finished. A pull already lapsed this way is sent a new review once the check is green, and the sweep sends exactly one.
- No loop. The clock restarts only for a run that overlapped a pending check. A review run that overruns after the check is green still counts, so the retry limit holds.
- "Waiting on check". The pull page already says "queued to check" or "checking now" while the check is pending, and a pending check never produces a lapse. I left that wording alone.
Tests: test/review-check-queue.test.ts has three cases:
- A check queued three hours is never sent and never lapses.
- Two reviews that overran behind a 170-minute re-queued check are discounted. The pull is not owed to a person, and one new review is sent after green.
- A run that stood down for the queue is not an attempt.
It passes, along with review-outage, crew-review, crew-review-budget, crew-now-review-waits, crew-review-rounds and asks-counts. tsc is clean, and gate --fix rewrapped comments, which are in the commit. I did not run the whole suite.
Not done
- I did not stop the reviewer being handed a preview URL while the preview deploy is still waiting. That could be what kept the runs busy, but I couldn't confirm it.
- I didn't touch the check lane's one-at-a-time throughput.
- #15694 is not covered. It failed under sentinel, which this change doesn't touch.
Try it: open an agent pull, then hold its check in queued for more than an hour. The pull should stay with the crew and no review run should be created. When the check turns ok, one review is queued.
🤖 Generated with Claude Code
A pull's review starts only once its check is green, and a run waiting on the check queue is not cancelled Pulls #15694, #16009, #16012, #16018 and #16035 were handed to the owner as "the reviewer did not answer". Each has 4 to 7 agent runs, and every finished one ended cancelled after 24 to 34 minutes (e.g. #16018: 14:02:35 to 14:35:08 UTC; #16035: 14:13:24 to 14:45:14; #16009: 14:18:28 to 14:51:51), then a new run was queued. #15694 was picked up by sentinel, failed, and has waited 13 hours with no retry.
At the same time the check lane runs one check at a time (a passing check takes about 44 minutes) with about 14 queued, the oldest since 13:13 UTC, and 11 deploys sit "running" for 40 minutes to 1h 44m waiting on checks. A review run that waits for a check behind that queue cannot finish inside its ~30 minute window, so it is cancelled, requeued, and finally lapses to the owner. This is the same stall as Nov 20; #1216 (reviewer clock from checks green) closed without landing (pull #1500 closed).
Done when: