You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pr_review.py wait Reports a Spent Quota Refusal as Exit 46 When a Later Round on the Same Head States No Coverage #2820
scripts/pr_review.py wait exits 46 (COPILOT_QUOTA_EXHAUSTED, "the newest Copilot review declined") on a pull request whose newest Copilot review is a genuine round, not a refusal.
Constructed shape that triggers it. All rounds sit on the same head H:
Copilot round 1 on H: the body is the account-quota refusal ("Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.").
The quota is restored, then wait <n> --request --ignore-quota-signal --min-rounds 2.
Copilot round 2 on H is a genuine ccr-overview-v2 round, "Approval recommended", 0 open findings, with no file table and no coverage statement.
Observed: the digest line reads rounds=2 review_on_head=yes refusal=no coverage=unstated, then status=COPILOT_QUOTA_EXHAUSTED ... and exit 46. status on the same head exits 45 (COVERAGE_IS_UNSTATED), which is the accurate reading.
Expected: wait reports the same state status does, coverage unstated (exit 45). The refusal on H is spent by the later genuine round on H.
Cause
refusing_review() returns the newest refusal on the head without checking for a later genuine round on that head. Its docstring says the caller handles that case, since "main returns 0 on reviewed_head before reaching here". That holds only when the reviewed head is also complete. A genuine round with unstated coverage does not return 0, so wait falls through to the refusal and quota_refusal(refusal) branch and reports exit 46 from the spent refusal. The --ignore-quota-signal flag guards only stopping_refusal, not this path.
Impact
Exit 46 tells the driver that an account-level state blocks the round and that nothing the loop does clears it. That sends the pull request to the maintainer as a quota problem when the quota was already restored and the actual gap is coverage. It also contradicts the digest's own refusal=no field.
Fix
Have refusing_review() (or the wait branch that calls it) treat a refusal as spent where a later non-refusal Copilot round exists on the same head. Add a test with the two-round shape above.
Activity
Spend a Head Refusal a Later Genuine Round on That Head Answers (#2825)
Promote Prose Gate, Review Tooling, Unattended Worker, and Install Fa…