Repository navigation
review-pr: the queue notice was wrong in both directions - #7615
Conversation
Ten requests fired together queued eight whole runs at the hosted runner before any gate job could run, and every gate that did read "queued behind 1" -- the requests it could not see were exactly the ones ahead of the requester, and the 8-hour limit saw a shallow queue the whole time. In the other direction, the estimate was a constant taken from the longest review anyone had seen: the rollout measured 17/18/19/20/22/26 min (median 20) while every notice said 50, so a requester was told to expect 2.5x what the box does, and the wait limit fired 2.5x early. A queued run of this workflow is a real request: a comment without the trigger phrase skips the gate job's `if` in seconds without ever waiting for a runner, so a run still queued passed it. survey() now reads those runs too. But a review job sitting at "queued" is ambiguous -- waiting for the box, or its own gate never got a hosted runner -- and the gate job's completed/success state is what tells them apart. A request still short of the box counts toward the queue but never toward the no-runner verdict: a starved hosted runner is not a dead box, and paging the runner's owner over one would send someone to a healthy box. The estimate is now measured, not remembered: recent_review_minutes() times the review job of the last few completed runs and the gate prices the queue by the median. Refused requests conclude successfully too, with no review to time, so they are skipped rather than priced. A history that cannot be read degrades to the constant with a warning -- the ETA is a courtesy, not a gate. queue_gate_test.py grew five cases and four mutants, and its fake now serves runs by status, so paging and URLs stay shipping code. selftest 108 green / 0 red, check_prompts 0 drift. Co-Authored-By: Claude Code <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
Co-Authored-By: Claude Code <[email protected]>
* review-pr: the queue notice was wrong in both directions Ten requests fired together queued eight whole runs at the hosted runner before any gate job could run, and every gate that did read "queued behind 1" -- the requests it could not see were exactly the ones ahead of the requester, and the 8-hour limit saw a shallow queue the whole time. In the other direction, the estimate was a constant taken from the longest review anyone had seen: the rollout measured 17/18/19/20/22/26 min (median 20) while every notice said 50, so a requester was told to expect 2.5x what the box does, and the wait limit fired 2.5x early. A queued run of this workflow is a real request: a comment without the trigger phrase skips the gate job's `if` in seconds without ever waiting for a runner, so a run still queued passed it. survey() now reads those runs too. But a review job sitting at "queued" is ambiguous -- waiting for the box, or its own gate never got a hosted runner -- and the gate job's completed/success state is what tells them apart. A request still short of the box counts toward the queue but never toward the no-runner verdict: a starved hosted runner is not a dead box, and paging the runner's owner over one would send someone to a healthy box. The estimate is now measured, not remembered: recent_review_minutes() times the review job of the last few completed runs and the gate prices the queue by the median. Refused requests conclude successfully too, with no review to time, so they are skipped rather than priced. A history that cannot be read degrades to the constant with a warning -- the ETA is a courtesy, not a gate. queue_gate_test.py grew five cases and four mutants, and its fake now serves runs by status, so paging and URLs stay shipping code. selftest 108 green / 0 red, check_prompts 0 drift. Co-Authored-By: Claude Code <[email protected]> * review-pr: the github class outgrew its "three calls" docstring Co-Authored-By: Claude Code <[email protected]> --------- Co-authored-by: zufayu <[email protected]> Co-authored-by: Claude Code <[email protected]>
What this changes
Two defects in the queue gate, both found in the rollout, both in the same notice:
A burst was invisible.
survey()read onlystatus=in_progressruns. Ten requests fired together queued eight whole runs at the hosted runner before any gate job could run — and every gate that did run said "queued behind 1 review(s)" to a requester with six ahead of them. The 8-hour limit saw a shallow queue the whole time, so it refused nothing: it was designed against queue depth and only ever saw steady-state depth.The estimate was a constant remembered, not measured.
AVG_REVIEW_MINUTES = 50came from the longest review anyone had seen. The rollout measured 17/18/19/20/22/26 min (median 20), so every notice carried an ETA 2.5x high and the wait limit fired 2.5x early.Why
A queued run of this workflow is a real request: a comment without the trigger phrase skips the gate job's
ifin seconds without ever waiting for a runner, so a run still sitting atqueuedpassed thatif.live_runs()now readsin_progressandqueued.But a review job at
queuedis ambiguous — waiting for the box, or its own gate never got a hosted runner — and the two demand opposite responses. The gate job'scompleted/successstate is the discriminator:The mechanism
watchdog.py— paging refactored into_runs(repo, *statuses);in_progress_runskeeps its behavior (box_busystill asks only that: a queued run holds no runner). Newlive_runs()andrecent_review_minutes(repo, want), which times the review job of the last few completed runs. Refused requests conclude successfully too, with no review to time, so they are skipped rather than priced.queue_gate.py—survey()returns(running, waiting, arriving);decide()countsarrivingtowardaheadand the ETA but never toward no-runner. The estimate is the median of the last 8 completed reviews, falling back to the constant — with a warning — when the history cannot be read. The ETA is a courtesy, not a gate.queue_gate_test.pygrew five cases and four mutants, and its fake now serves runs by status, so paging and URLs stay shipping code. selftest 108 green / 0 red, check_prompts 0 drift.🤖 Generated with Claude Code