Skip to content

feat: implement issue #711 — pr-review: rate-limited reviews are never auto-retried (no equivalent of dev-lead-retry) - #720

Merged
don-petry merged 4 commits into
mainfrom
dev-lead/issue-711-20260614-2005
Jun 14, 2026
Merged

don-petry merged 4 commits into
mainfrom
dev-lead/issue-711-20260614-2005

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Closes #711

Implemented by dev-lead agent. Please review.

…r auto-retried (no equivalent of dev-lead-retry)
@don-petry
don-petry requested a review from a team as a code owner June 14, 2026 20:29
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 41 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c82bf7a5-0099-4d86-81ec-80a158acd92d

📥 Commits

Reviewing files that changed from the base of the PR and between 0c069f3 and 56a6889.

📒 Files selected for processing (5)
  • scripts/lib/advisory-review-gate.sh
  • scripts/review-one-pr.sh
  • scripts/sweep-stuck-reviews.sh
  • tests/dev-lead/unit/test_advisory_review_gate.bats
  • tests/test_sweep_stuck_reviews.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-711-20260614-2005

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 14, 2026 20:30

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces rate-limit detection and auto-retry handling for advisory/review bots that withhold reviews due to quota limits (issue #711). It adds logic to detect rate-limited bots, post a machine-detectable marker comment with a reset timestamp, and automatically re-dispatch reviews once the reset time has elapsed. The feedback highlights several critical improvements: replacing inside with any in jq to avoid unexpected substring matching of bot names, adding BSD date fallbacks to ensure macOS compatibility when parsing and calculating timestamps, and defensively filtering comments before using jq's capture function to prevent runtime errors on malformed markers.

Comment thread scripts/lib/advisory-review-gate.sh Outdated
Comment thread scripts/review-one-pr.sh Outdated
Comment thread scripts/sweep-stuck-reviews.sh Outdated
Comment thread scripts/sweep-stuck-reviews.sh Outdated
@don-petry
don-petry disabled auto-merge June 14, 2026 20:31
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 14, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 14, 2026 20:36
@don-petry
don-petry disabled auto-merge June 14, 2026 20:42
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 14, 2026 20:43
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge June 14, 2026 21:16
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 14, 2026 21:17

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 56a68897cab66d1a4999ab7eef9bff4602916e84
Review mode: triage-approved (single reviewer)

Summary

Implements issue #711 (Option 1): makes pr-review-sweep rate-limit-aware so PRs withheld because advisory bots were out of quota auto-recover after the limit resets, instead of stranding at REVIEW_REQUIRED with green CI. Adds rate-limit detection + a machine-detectable marker in the advisory gate, and reorders the sweep to handle the rate-limited retry before the CI-green gate.

Linked issue analysis

Closes #711. All five acceptance criteria are met: (1) a withhold due to rate-limited advisory bots stamps a status=rate-limited marker (maybe_post_rate_limited_marker); (2) after the reset window the PR is re-dispatched via the normal trigger with no force_review (dispatch_review; tests assert force_review is never used, keeping the advisory gate armed); (3) unrelated cancelled/failed sibling checks no longer suppress the retry because the rate-limited branch runs before the CI-green gate (tests cover FAILING and CANCELLED siblings, AC3); (4) idempotency for non-rate-limited PRs is preserved (reviewed-at-head skip retained); (5) bats coverage added in both tests/test_sweep_stuck_reviews.bats and tests/dev-lead/unit/test_advisory_review_gate.bats.

Findings

No outstanding issues. All four prior gemini-code-assist review threads are resolved with fixes confirmed in the diff: inside replaced with any(. == $b) for exact bot-login matching (no substring false positives); GNU/BSD date fallbacks added in both review-one-pr.sh and sweep-stuck-reviews.sh for macOS; and a defensive and test("reset=[^ ]+") pre-filter before jq capture to avoid a runtime abort on malformed markers. Marker posting is deduplicated per head, the gate is sourced in an isolated subshell so its helpers/vars do not leak, and an unparseable reset fails open to a retry so a malformed marker cannot strand a PR. No auth/secrets/workflow-permission changes; changes are confined to shell orchestration logic plus tests.

CI status

All checks green. Required/security checks passing: CI (Lint, ShellCheck, Compile agentic workflows, Secret scan gitleaks, Agent Security Scan), CodeQL (actions + python), AgentShield, SonarCloud (Quality Gate passed, 0 new issues), bats, unit-tests, and Test Dev-Lead Agent suite. Remaining entries are SKIPPED (dependabot/dependency-audit ecosystems not applicable). No failing or cancelled gating checks.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit 59e9aa3 into main Jun 14, 2026
36 checks passed
@don-petry
don-petry deleted the dev-lead/issue-711-20260614-2005 branch June 14, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pr-review: rate-limited reviews are never auto-retried (no equivalent of dev-lead-retry)

2 participants