Closed
Description
scripts/pr_review.py wait carries two inline copies of one bounded backoff loop. The Copilot review poll and the held-head check poll (added for #2685) each index delays[min(i, len(delays) - 1)], check time.monotonic() - start against --timeout, sleep, then re-read. A later fix to the timeout check, the delay schedule, or the overshoot past --timeout (up to one 120-second delay) has to be applied to both sites, and one copy is easy to miss.
Done looks like
- One helper owns the backoff loop, taking the read to repeat and the condition to keep polling on, and both
waitsites call it. - The Copilot poll keeps its current stop conditions, including the
--ignore-quota-signalpath that forcesdonefalse before the loop starts. - The existing
waittests pass unchanged, and a test pins the helper's timeout and delay schedule once.
Raised in review on #2722.
Activity
ptr727 commentedon Oct 10, 2026
Also in scope: the held-head check poll reads the full
Q_FULLdocument on every iteration, though the loop needs only the reviews, comments, review requests, state, merge state, and rollup thatholds,local_cover,unrecognized_shapes, andheld_checks_openread. Review threads and the files window are needed only by the final digest. A narrower poll document withQ_FULLkept for the final read would cut each iteration's cost. Raised in local review on #2722.Poll an Attested Head's Checks in pr_review.py wait (#2722)
Share One Bounded Backoff Loop Between pr_review.py wait's Two Polls (#…