Skip to content

pr_review.py wait's quota-detection lookback ages out during a long Copilot outage #985

Description

@ptr727

pr_review.py wait's fast quota-exhaustion detection (exit 46/47, added in
v2.0.457) depends on finding a Copilot bot ID by scanning the last 20 PRs for
any Copilot review. During an outage that outlasts 20 PRs, that window empties
out and the detector can no longer run at all, falling back to blind polling
for the full timeout (2700s) before giving up with a plain PENDING.

Reproduced today (2026-08-25), PRs #981-984

  • wait 981 and the first wait 982: instant exit 47
    (COPILOT_QUOTA_EXHAUSTED_REPO_WIDE), keyed off a refusal found on PR Make Local Pre-Commit Hooks Strongly Suggested Fleet-Wide #962.
  • wait 983 and the second wait 982: ran the full ~2700s before exiting 30
    (PENDING), logging first:
    auto-request: no Copilot review found across the last 20 PRs to read the reviewer bot id from, so nothing was requested here; polling only.

Between the two, PR #962 (and every other PR carrying a Copilot review or
refusal) aged out of the 20-PR lookback, since every PR since has gone
through the same quota-exhausted stretch with zero Copilot activity to find.

Ask

Widen the bot-ID lookback (or fall back to a wider one automatically) when
the last 20 PRs carry no Copilot activity at all, so the fast-path detector
keeps working through an outage that outlasts its own history window instead
of reverting to a 45-minute blind poll on every call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions