Repository navigation
Read CodeRabbit's Command-Reply Rate Limit in pr_review.py - #3128
Conversation
An explicit `@coderabbitai review` that CodeRabbit cannot run gets back an `auto-generated reply` marker over an `Action not completed` block saying `Review rate limited.`, a shape RATE_LIMITED never matched. On a repository where CodeRabbit never auto-reviews, that was the only rate limit the digest could meet, so `other_rate_limited` read the same for "asked and limited" as for "never asked". rate_limited_by now reads that shape from its markers and fixed block text, naming the service by login since the marker names none, and surfaces it in the same `other_rate_limited` field. The auto-review marker reads as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the login fallback for an unmapped reviewer, which no input reaches, so a reply-shape notice from a login with no known service stays unread as the auto-review marker's own comment says. Correct the docstrings that said the reply marker names no service, and split the sentences the sentence-length check flagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the reply pattern's comment spans from running past a closing "-->", say the reply lands in the same field by a pattern of its own, move the not-head-scoped reason into the reader's docstring, and test that a reply from a login with no known service stays unread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
The comments near RATE_LIMITED and in digest still described one marker shape and a service name taken from the marker. The rate_limited_by docstring gave the plain-comment observation as the reason for reading both connections, and a test docstring said the reply names no service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟢 Approval recommended
The implementation and tests cover the new behavior; remaining findings are documentation nits.
2 open findings
What changed in this PR
Adds CodeRabbit command-reply rate-limit detection and related test coverage.
Changes:
- Parses reply-shaped rate-limit messages.
- Maps logins to service names in digest output.
- Adds positive, near-miss, and unmapped-login tests.
- Updates related documentation.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Tests reply detection and attribution edge cases. |
scripts/pr_review.py |
Detects and reports CodeRabbit reply rate limits. |
🧠 Review effort: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3128 +/- ##
==========================================
Coverage ? 63.97%
==========================================
Files ? 17
Lines ? 9151
Branches ? 0
==========================================
Hits ? 5854
Misses ? 3297
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
@coderabbitai review |
✅ Action performedReview finished.
|
… Fixes to Main (#3146) - #3135 makes `gh-write-guard` read a gh write's subcommand and target the way gh parses them: the subcommand is found past flags before the command and before the subcommand, an `R` inside a short-option cluster is read as a target, `GH_REPO` is read as a target, a run-time repository owner on a write fails closed, and a run-time word where `pr` or `merge` goes fails closed beside `--admin` or where word splitting may split it - #3139 releases the bootstrap lock when a `bootstrap.ps1` run ends rather than when its process does, so a second run typed at the same pwsh prompt is no longer refused the lock - #3130 matches tool names and the `all` keyword by case in the Windows agents loaders, as the Linux loaders already do - #3128 reads CodeRabbit's rate limit on a reply to an explicit review command in `pr_review.py` - #3126 reconciles VSCode-Server-DotNetCore in the hub after its resync - #3124 logs the Docker task's build-base leg in to Docker Hub - #3122 names the carried skill and the skipped review correctly - #3120 states the subprocess encoding rule in `CODESTYLE.md`, where carriers read Python style - #3118 and #3111 move the release-guard tests' workflow-command checks onto `runner_commands`, and test the alternatives wiring at the `audit_repo` and `fidelity_pass` call sites - #3116 stops the doc gates' printed names forging workflow commands - #3113 adds a catalog snippet for the release-with-smoke caller - #3109 moves the `workflow_reuse` fetch onto `audit.contents_text` - #3105 accepts `.codecov.yml` as an alternative to `codecov.yml` - #3103 adds a pip ecosystem to the carried Dependabot snippet - #3100 prefers the venv's ruff and pyright for a declared pip directory - #3098 tracks composite action pins in Dependabot - #3096 reads an uppercase Markdown suffix as Markdown at every prose gate branch After this merges, the host-safety installer payload changes, so the maintainer runs the installer after promotion. Closes #1416 Closes #1425 Closes #1578 Closes #1874 Closes #1892 Closes #1899 Closes #2804 Closes #2850 Closes #2852 Closes #2854 Closes #2996 Closes #3065 Closes #3067 Closes #3069 Closes #3079 Closes #3080 Closes #3089 Closes #3093 Closes #3101 Closes #3106 Closes #3107 Closes #3137 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a pull-request smoke build that runs when relevant release files change and reports the combined validation and build status. * Repository audits now recognize `.codecov.yml` as an alternative to `codecov.yml`. * **Improvements** * Python linting and type checks use tools from declared project environments when available, with fallbacks for missing tools. * Workflow and lint reports safely display unusual filenames and command-like text. * GitHub write-target checks now account for additional command forms and fail closed when targets cannot be verified. * Rate-limit detection now recognizes another CodeRabbit response format. <!-- end of auto-generated comment: release notes by coderabbit.ai -->

Summary
scripts/pr_review.pyread CodeRabbit's rate limit only from the auto-review notice'sauto-generated comment: rate limited by <service> -->marker. An explicit@coderabbitai reviewthat CodeRabbit cannot run comes back in a second shape, anauto-generated replymarker over anAction not completedblock sayingReview rate limited.. That shape never matched. On a repository where CodeRabbit never auto-reviews, it is the only rate limit the digest can meet, soother_rate_limitedread the same for "asked and limited" as for "never asked".RATE_LIMITED_REPLYreads the reply shape from its markers and the block's fixed text alone, never the prose around them.rate_limited_bychecks the existing marker first, then the reply shape. The reply's marker saysCodeRabbitrather thancoderabbit.ai, soRATE_LIMIT_SERVICEnames the service by login. That gives the sameother_rate_limited=coderabbitai:coderabbit.aireading as the auto-review notice. A login missing from that map stays unread.Tests in
tests/test_pr_review.pycover these cases, all built from constructed comment bodies:rate_limited_byand through the digest fieldWith the reply branch disabled, the new tests fail.
The issue's side question, whether a limit with no stated retry time should read differently from one with a countdown, is out of scope here, and that reading is unchanged.
Closes on promotion: #1425
Local review findings from the opening push
The pre-push pass's edit budget was spent on the opening push. It left these
introducedfindings open. Each is fixed in 243f674, and the pass over that push raised none:introduced: scripts/pr_review.py, three#comments nearRATE_LIMITEDand indigeststill describe one marker shape and service names taken from the marker.introduced: scripts/pr_review.py, in therate_limited_bydocstring, "both observed shapes ride a plain PR comment" is given as the reason for reading both connections, which it does not support.introduced: tests/test_pr_review.py, a test docstring says the reply "names no service", which contradicts the code docstring.🤖 Generated with Claude Code
Summary by CodeRabbit