Skip to content

Share One Bounded Backoff Loop Between pr_review.py wait's Two Polls #2723

Closed

Description

@ptr727

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 wait sites call it.
  • The Copilot poll keeps its current stop conditions, including the --ignore-quota-signal path that forces done false before the loop starts.
  • The existing wait tests pass unchanged, and a test pins the helper's timeout and delay schedule once.

Raised in review on #2722.

Activity

  1. added
    chore
    script
    on Oct 10, 2026
  2. ptr727 commented on Oct 10, 2026

    @ptr727
    OwnerAuthor

    Also in scope: the held-head check poll reads the full Q_FULL document on every iteration, though the loop needs only the reviews, comments, review requests, state, merge state, and rollup that holds, local_cover, unrecognized_shapes, and held_checks_open read. Review threads and the files window are needed only by the final digest. A narrower poll document with Q_FULL kept for the final read would cut each iteration's cost. Raised in local review on #2722.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    chorescript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions