Repository navigation
[CI] Serve N parallel reviews with a runner pool - #9037
Conversation
One agent serves one review at a time, and 18 queued requests at ~24 min each was a 7-hour wait. GitHub Actions parallelises across a pool by itself: every agent registered with the same labels picks up queued review jobs as it frees, so N agents review N PRs concurrently with no workflow change. The per-PR concurrency group still serialises repeat reviews of one PR, which is correct. What stayed single-lane was everything that TALKS about the box: - queue_gate priced the wait as queue-depth x one review, so a pool would quote every requester an N-times-too-long ETA and refuse work N times too early. It now divides the wait by AITER_REVIEW_LANES (a repo var, default 1 = today's arithmetic and wording, unchanged). - The workflow did not pass that var through; check_prompts now holds the reader and the pass-through together, because a var the workflow does not pass is not an error anyone sees. - preflight vouched for whichever runner unit sorted first, so one hand-started agent among N would read green while being one reboot away from quietly taking the box below its quoted lane count. It now checks every unit and reports the pool size. - RUNNER-SETUP documents the pool: one directory, .env and service per agent, the repo var, and the capacity line -- each lane holds one request slot on the model endpoint, so N lanes must fit it. The watchdog needed no logic change: a queued job behind a full pool is the normal state the gate already quoted an ETA for, and a dead box is still 'nothing running at all'. Only its wording said 'single runner'. Tests: the queue gate divides the wait by the lanes, accepts a queue the lanes can work through, falls back to one lane on an unusable var, and two mutants hold the arithmetic; the watchdog stays silent behind a full pool. selftest.sh: 153 green. 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: Reviews: |
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
Summary
Let the review box serve several PRs at once: register N runner agents with the same labels and GitHub dispatches queued review jobs to whichever agent is free. No dispatch logic changes — the pool is the mechanism. This PR fixes everything downstream that still assumed one lane.
Motivation
18 queued requests at a ~24 min median was a 7-hour wait, with requesters' own PRs at the tail. The box's model endpoint has capacity to spare (one request slot per concurrent review), so the constraint was the single registered agent, not the hardware.
Changes
box308labels, one directory +.env+ systemd service each (RUNNER-SETUP.md §7, new). The per-PRconcurrencygroup still serialises repeat reviews of one PR — two reviews of one PR must not interleave.queue-depth × one review, so a pool would quote every requester an N-times-too-long ETA and fire the too-deep refusal N times too early. The wait is now divided byAITER_REVIEW_LANES(repo var, default 1 = today's arithmetic and wording, byte for byte).AITER_REVIEW_LANESthrough, and check_prompts.py holds the reader and the pass-through together — a repo var the workflow forgets to pass is not an error anyone sees; it is just a pool quoted as one lane, silently, forever.Testing
selftest.sh: 153 green / 0 red.actionlintclean on the workflow.Rollout
AITER_REVIEW_LANESto the agent count.preflight.sh— it now vouches for every agent.PR Self-Review
Reviewed revision
339bc17
Behavior and intent
The review box moves from one registered runner agent to a pool of N. GitHub Actions already dispatches queued jobs to any idle agent with matching labels, so the pool itself is operational, not code. What still assumed one lane:
queue_gate.pypriced the wait as queue-depth × one review (an N-times-too-long ETA, refusal N times too early), the workflow did not passAITER_REVIEW_LANESthrough,preflight.shvouched for whichever runner unit sorted first, andwatchdog.pywording said "single runner". One lane is insufficient because the queue sat 18 deep at a ~24 min median (a 7 h wait) while the model endpoint had capacity for several concurrent reviews.Validation and unverified scope
Validated:
selftest.sh153 green / 0 red;actionlintclean; the queue gate driven against live ROCm/aiter API data (lanes=1 and lanes=4 arithmetic and wording); the drift guard red when the workflow stops passing the var, green restored; live pool verification on a scratch repo — 4 registered agents, 6 dispatches: the 4 distinct-key jobs ran simultaneously (one per agent, 4×90 s jobs in ~105 s wall) and the 2 same-key dispatches serialized behind the concurrency group even with idle agents, all 6 green. Unverified: the production rollout itself (registering the extra agents on the box, setting the repo var) — it needs a repo admin for the registration token; the steps are the PR's Rollout section.PR-specific question
No new permissions. The hosted jobs keep
contents:read/actions:read, the review job is unchanged, and the only new input is the repo variableAITER_REVIEW_LANES, read byqueue_gate.pywith a fallback to 1 on any unusable value (a bad var cannot crash the gate). Fork PR code cannot reach it: the workflow triggers onissue_commentfrom allowlisted commenters only, and the gate runs onubuntu-latestbefore any self-hosted checkout. The var influences only the ETA text and the queue-depth refusal threshold — no privileged execution path.Changed op tests
None
🤖 Generated with Claude Code