fix(automation): stop mention sweep after shared rate-limit exhaustion - #1012
fix(automation): stop mention sweep after shared rate-limit exhaustion#1012seonghobae wants to merge 4 commits into
Conversation
|
Warning Review limit reached
Next review available in: 45 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Exact-current-head read-only review request for This focused TDD repair stops an organization-wide mention sweep immediately after the first explicit GitHub primary or secondary installation-rate-limit exhaustion, while preserving isolation for ordinary candidate-local failures. Exact-head Agent Mention Router Quality CI and the hosted security, SAST, supply-chain, and dependency checks are terminal-success; unresolved inline threads are zero. The PR is now Ready and auto-merge is armed subject to independent approvals and protected-main rules. Review this exact head only. Preserve reviewer identities and credentials; do not mutate the branch, synthesize author approval, weaken protection, or merge. @opencode-agent review |
|
@opencode-agent @cwl-noema-review @coderabbitai review Review exact head |
Rate Limit Exceeded
|
There was a problem hiding this comment.
The fail-fast direction is right, but this head is not yet safe to merge.
is_rate_limit_exhaustion looks for the contiguous phrase api rate limit exceeded. GitHub also returns API rate limit already exceeded. That string does not contain the needle, so the sweep would keep walking repositories and recreate the 116-failure amplification.
The tests also mock away list_recent_pull_requests, which is the incident path. main() still lets SweepRateLimitExhausted escape as a traceback, so the scheduled job does not tell the operator to wait for the installation budget reset.
Do not merge this head. Land the classification, incident-path, and CLI-exit repair on cursor/bc-5bb76fb1-67aa-4840-8b3a-1fe7792dd979-6966 (or cherry-pick that commit onto this branch), then re-run Agent Mention Router Quality CI on the new exact head.
Sent by Cursor Automation: fix all
|
|
||
| message = " ".join(str(error).split()).casefold() | ||
| return ( | ||
| "api rate limit exceeded" in message |
There was a problem hiding this comment.
This contiguous needle misses API rate limit already exceeded. That GitHub wording inserts already between limit and exceeded, so the first exhausted repository would be recorded as an isolated skip and later repositories would keep consuming the empty installation budget.
Match rate limit plus exceeded/exhausted, or secondary rate limit. Add a regression that feeds the already exceeded string and proves the next repository is never requested.
| counters.failures += 1 | ||
| message = " ".join(str(error).split()) or error.__class__.__name__ | ||
| print( | ||
| f"::warning::Agent mention sweep skipped {scope}: {message[:1000]}" |
There was a problem hiding this comment.
This still says the scope was skipped, then raises. Operators will treat it as a local skip and re-run. Emit ::error:: with the next action: wait for the installation REST budget to reset; do not re-run this sweep immediately. Catch SweepRateLimitExhausted in main() and return 1 so the scheduled job fails closed without a traceback.
2fa5e6a to
767432d
Compare
|
Exact-current-head review request for |
767432d to
42715e9
Compare
|
Rebased onto current |
42715e9 to
0cccd7f
Compare


Incident
Scheduled
Review Agent Mention Routerrun31868885733exhausted the OpenCode GitHub App installation REST budget and then continued traversing organization repositories. The run produced zero dispatches and 116 isolated failures, including.github#1008andbandscope, after the first installation-wideAPI rate limit exceededresponse.Test-first repair
e5e255272f0cef3ed9c4b0b365d5df793cf46807adds focused regressions proving primary installation-budget exhaustion must stop before a second PR is touched and that secondary-rate-limit messages are also sweep-global.602d4f91f5b58657f1d8e00c18ae0b2a20900280addsSweepRateLimitExhaustedplus exact message classification and raises after recording the first exhausted scope.2502f665a1b74cb7814c01535c3dbaf3a20ce259records the incident, trust boundary, rollback, and APA 7 references to GitHub's primary/secondary REST and GitHub App rate-limit guidance.Boundary
The repair does not retry, sleep, widen permissions, rotate credentials, alter reviewer identity, change the canonical invocation key, weaken the exact-name artifact ledger, or represent failed work as dispatched. Ordinary candidate-local failures remain isolated. Explicit GitHub primary/secondary exhaustion stops only the current scheduled sweep so it cannot amplify an already exhausted shared installation budget.
This is complementary to concurrency-isolation PR #835 and dispatch-envelope PR #840; it does not duplicate their queue or payload changes.
Exact identity
main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba2502f665a1b74cb7814c01535c3dbaf3a20ce259scripts/ci/agent_mention_sweep.py,tests/test_agent_mention_rate_limit.py,docs/doctoring/agent-mention-rate-limit-fail-fast.mdMerge gate
Keep Draft until exact-current-head Agent Mention Router Quality CI, 100% owned statement/branch/docstring coverage, security/SAST/supply-chain checks, current semantic review, zero valid unresolved threads, two qualifying non-author formal approvals including last-push approval, and protected-main branch rules are all satisfied. No queued, failed, predecessor-head, self/author, or bypass evidence is acceptance.