Repository navigation
CodeRabbit's Security Architecture Review is throttled separately from its code review — findings in both sections must be addressed, and an in-place edit after disposition must re-open the comment #2008
Copy link
Copy link
Closed
Labels
bugBug reportsBug reportsdev-leadFor dev-lead agent pickupFor dev-lead agent pickupsecuritySecurity-related PRs and issuesSecurity-related PRs and issues
Description
Problem
CodeRabbit now posts two independently throttled outputs in one summary issue comment, which it edits in place:
- Code review. This part can be rate-limited ("Review limit reached — You've used all free OSS reviews for now…").
- Security Architecture Review. This part is not throttled with the code review and can carry real findings while the code review shows the rate-limit block.
Our automation treats that comment as a single unit. It also only reacts to newly created comments. As a result, a security finding that CodeRabbit adds by editing an already-dispositioned summary is never addressed and never re-blocks the gate.
Live evidence: PR #2000, comment 5938681830 (coderabbitai[bot], created 19:12Z, edited in place through 21:15Z)
The section markers, in order:
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: rate limited by coderabbit.ai --> … <!-- end of auto-generated comment: rate limited by coderabbit.ai -->
<!-- recent_review_start --> … <!-- recent_review_end -->
<!-- walkthrough_start --> … <!-- walkthrough_end -->
<!-- final_review_risk_start --> … <!-- final_review_risk_end -->
<!-- architecture_review_start -->
### Security Architecture Review
**Security architecture risk:** _🟡 Moderate_ · up to `769f3`
…
**Retained concerns**
- **Medium · security · inferred:** New exemptions classify an entire registered-reviewer comment as clean when only its opening notice matches. …
<details><summary>Security review details</summary> … **Hardening Proposals** … </details>
<!-- architecture_review_end -->
At the same moment, the rate-limit block covered commits 769f3dd→2c77e41, while the security section still reported a finding at 769f3.
Timeline:
- 19:23Z: Dev-Lead posted disposition 5938896990,
disposition=informational("rate-limit/summary notice — no actionable review finding"). The comment was then minimized RESOLVED. - ~20:35Z: CodeRabbit edited the same comment to add the Moderate security finding.
- After that: no automation re-opened, re-dispositioned or addressed it. It was fixed only because a human-driven session acted on it manually (reply 5940203474).
CodeRabbit had no review threads on #2000, and its two PR reviews were DISMISSED with empty bodies. The security finding existed only inside the edited summary comment.
Similar stale dispositions:
- feat: implement issue #1994 — Rate-limited PR reviews wait up to ~7h after the limit resets — the retry relies on GitHub's best-effort cron, which fires far less often than every 15 min #1999 (5938846806) described the comment as a "review in progress placeholder"; CodeRabbit later edited it into a rate-limit notice.
- feat: implement issue #1993 — Stop the Codex noise: auto-clear chatgpt-codex-connector "usage limits" notices so they stop blocking the maintainer gate and spawning dev-lead runs #1998 (5938594515) described it as a "review-in-progress / walkthrough summary".
Root causes (code on main)
- Edits are invisible.
dev-lead.yml:42–43triggers onissue_comment: types: [created]only. So dopersona-mention.ymlandpr-review-mention.yml.- Neither
scripts/lib/maintainer-comment-gate.sh(:164–186) norscripts/lib/comment-disposition-verify.shcompares the comment'supdatedAt/lastEditedAtwith the disposition's time. - Once a comment is minimized RESOLVED it stays cleared, whatever the bot appends later.
- No section awareness.
prompts/dev-lead/fix-bot-comment.md:113–125dispositions a "rate-limit / 'review limit reached' notice" asinformational, and:36says "A neutral overview is not an actionable finding".- Nothing tells the agent to look inside CodeRabbit's sections:
architecture_review/Security,Actionable comments posted,Outside diff range comments, nitpicks. - The rate-limit notice is what clears the whole comment, findings included.
- Security findings never become threads, so
fix-reviewsPhase 1,required_review_thread_resolutionandnotify_coderabbit_resolve(dev-lead-fix-reviews.sh:308–324) never see them. - The registry pattern targets text CodeRabbit doesn't post.
- The coderabbitai row at
scripts/lib/reviewer-sources.tsv:65matches the "…used up your prepaid credits" form. - The live notice is the OSS form ("You've used all free OSS reviews…"), inside a blockquote in the full summary.
- The pattern never matches a real comment (checked with jq
test()on feat: implement issue #1995 — info_status_pattern covers only SonarCloud — Codex/Qodo/CodeRabbit usage-limit notices are still undispositionable and still strand PRs #2000's body). That is fail-closed, so it is safe, but the row's rationale and its tests (tests/test_reviewer_sources.bats:219,266,tests/dev-lead/unit/test_maintainer_comment_gate.bats:347) describe a notice that doesn't occur. - Do not "fix" this by matching the OSS notice against the whole summary. That would auto-clear the security section along with it (info_status_pattern covers only SonarCloud — Codex/Qodo/CodeRabbit usage-limit notices are still undispositionable and still strand PRs #1995's "do not widen" rule).
- The coderabbitai row at
- Rate-limit detection matches the whole body and keys on creation time.
ADVISORY_RATE_LIMIT_RE(scripts/lib/advisory-review-gate.sh:94) is matched against the entire summary, so a walkthrough that merely mentions rate limits counts.detect_advisory_rate_limit(:301–326) picks the latest entry bycreatedAt/submittedAt, not by edit time.- Nothing tells "code review throttled" apart from "security review completed with findings".
Acceptance criteria
- Edits re-open dispositioned comments.
- If a registered bot's comment was edited after its covering disposition (
lastEditedAt/updatedAtlater than the disposition'screatedAt), the maintainer comment gate treats it as un-dispositioned. It is not cleared until a fresh disposition covers the current body. - Dev-Lead is triggered for such edits, either via
issue_comment: [edited]for trusted bots (deduplicated so CodeRabbit's frequent progress edits don't spawn a run each time) or a sweep check. - Fail closed when the timestamps can't be read.
- If a registered bot's comment was edited after its covering disposition (
- Both CodeRabbit sections are addressed.
- The
fix-bot-commentandfix-reviewsprompts treat a CodeRabbit summary as a set of sections. A rate-limit block covers only its own section. - Security Architecture Review findings ("Retained concerns", severity-labelled items, Hardening Proposals) and any "Actionable comments posted" / "Outside diff range" items each get a real disposition:
fixedwith a verifying commit, oranswered/out-of-scopewith a reason. - Only a body whose every finding-bearing section is empty or "no issues" may be dispositioned
informational.
- The
- A rate-limit notice never clears findings.
- No
info_status_patternor prompt rule may clear a CodeRabbit comment that contains anarchitecture_reviewsection with findings, or any other finding-bearing section. - Update the coderabbitai row's rationale so it no longer implies the prepaid-credits form is the live notice.
- Add a regression test built from feat: implement issue #1995 — info_status_pattern covers only SonarCloud — Codex/Qodo/CodeRabbit usage-limit notices are still undispositionable and still strand PRs #2000's real body (rate-limit block plus security finding): it must block, and must be refused on the
maintainer-resolve-comment.shbot path.
- No
- Section-aware rate-limit detection.
- CodeRabbit's rate-limit detection looks only inside the
rate limited by coderabbit.aimarker block, not the whole body, and uses the comment's last-edit time. - When the code review is throttled but the security section is present, the PR still waits on, or addresses, the security findings and is not treated as "no CodeRabbit evidence".
- CodeRabbit's rate-limit detection looks only inside the
- Tests:
- the edited-after-disposition gate case;
- the feat: implement issue #1995 — info_status_pattern covers only SonarCloud — Codex/Qodo/CodeRabbit usage-limit notices are still undispositionable and still strand PRs #2000-shaped body (throttled code review + security finding) blocks, and dispositioning only the notice does not clear it;
- a clean CodeRabbit summary (no findings in any section) can still be dispositioned
informational; - rate-limit detection ignores a walkthrough that merely mentions "rate limit".
Notes
- Related: info_status_pattern covers only SonarCloud — Codex/Qodo/CodeRabbit usage-limit notices are still undispositionable and still strand PRs #1995 / feat: implement issue #1995 — info_status_pattern covers only SonarCloud — Codex/Qodo/CodeRabbit usage-limit notices are still undispositionable and still strand PRs #2000 (anchored info-status patterns; "don't widen" rule), Recurring bot quota/trial notices (Codex usage limits, Qodo trial, CodeRabbit review-limit) still block approval — add info_status_patterns; fix stale maintainer-resolve refusal message #1932 (earlier quota-notice issue), [#1813 follow-up] Harden the comment-disposition gate: workflow-enforced provenance, ADR-0009, retire blanket @coderabbitai resolve, audit trail, no marker-less agent comments #1846 (disposition-gate hardening), dev-lead re-dispositions already-dispositioned PR comments on every pass — "expected exactly one, found N" then deadlocks the maintainer gate for good (#1952, #1953) #1992 / fix(dev-lead): idempotent comment dispositions and duplicate recovery (#1992) #2006 (latest-disposition selection; reuse
cdv_select_dispositionwhen comparing against edit time). - Scope: CodeRabbit is
advisory_gate=no, so this does not change the advisory quorum. It concerns whether CodeRabbit's findings are acted on, and whether its rate-limit notice can clear them.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug reportsBug reportsdev-leadFor dev-lead agent pickupFor dev-lead agent pickupsecuritySecurity-related PRs and issuesSecurity-related PRs and issues
Activity
github-actions commentedon Oct 1, 2026
Thanks for the detailed write-up and the live evidence from PR #2000 — it makes the failure mode very clear. To help us scope the fix, can you confirm the expected behaviour when CodeRabbit edits an already-dispositioned summary: should Dev-Lead be re-triggered immediately on the
editedevent (deduplicated), or is a sweep-time check oflastEditedAtvs. the disposition'screatedAtsufficient for your needs?don-petry commentedon Oct 1, 2026
Dev-Lead Implementation Plan
Issue: #2008 — CodeRabbit's Security Architecture Review is throttled separately from its code review
Scope
Make CodeRabbit's summary comment section-aware and edit-aware:
rate limited by coderabbit.aiblock, using last-edit time.Implementation Checklist
scripts/lib/reviewer-sources.sh— addreviewer_sources_finding_section_pattern, the single regex for finding-bearing sections:architecture_reviewsection with Retained concerns, severity items, Hardening Proposals or a non-minimal risk;Actionable comments posted: N>0,Outside diff range commentsandNitpick comments (N>0).scripts/lib/maintainer-comment-gate.sh:lastEditedAtis later than its latest covering disposition, or when that disposition isinformationalon a finding-bearing body.maintainer_gate_merge_edit_times(GraphQLlastEditedAtmerge, becausegh pr viewdoesn't expose it) and a pure stale-detector shared with the sweep.scripts/review-one-pr.sh— merge edit times into the snapshot before the gate runs.scripts/lib/comment-disposition-verify.sh— add purecdv_disposition_is_stale <edit_ts> <disp_createdAt>, which fails closed on bad timestamps.scripts/dev-lead-fix-reviews.sh(resolve_dispositioned_comments):lastEditedAt;informationaldisposition on a finding-bearing body.scripts/maintainer-resolve-comment.sh—mrc_bot_body_matchesrefuses a finding-bearing body.scripts/lib/advisory-review-gate.sh:architecture_reviewsection is evidence (COMMENTED), not RATE_LIMITED;lastEditedAt // createdAt.scripts/dev-lead-retry.sh— sweep trigger: dispatchfix-reviewswhen a dev-lead-dispositioned bot comment was edited after its disposition and no dev-lead run has posted since the edit. This is deduplicated, so CodeRabbit's progress edits don't spawn a run each time.issue_commenttrigger is standards-owned and can't be widened here.scripts/lib/reviewer-sources.tsv— fix the coderabbitai rationale: the prepaid-credits form isn't the live notice, and the live OSS notice is deliberately not matched.prompts/dev-lead/fix-bot-comment.mdandprompts/dev-lead/fix-reviews.md:informationalis allowed only when every finding-bearing section is empty;docs/pr-review-agent/maintainer-comment-gate.mdand AGENTS.md gate paragraph.Tests to Write
informationaldisposition.informationalclears.maintainer-resolve-comment.sh: the feat: implement issue #1995 — info_status_pattern covers only SonarCloud — Codex/Qodo/CodeRabbit usage-limit notices are still undispositionable and still strand PRs #2000 body is refused on the bot path.cdv_disposition_is_staleunit tests.Test Command
bats tests/dev-lead/unit/ tests/test_reviewer_sources.batsplusbash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Oct 1, 2026
Dev-Lead: Implementation Complete — PR #2009
The implementation for issue #2008 is durable: commits are pushed and a pull request is open. This record is backed by verifiable artifacts you can confirm in one click.
38191e6a2e839f50c9d708044954a07a734c4db8main: 22 file(s), +1724/-62 linesReview happens on the PR. Acceptance criteria and test results are evidenced by the PR's diff and CI checks — not asserted here. If a later stage fails, this claim is retracted in place.
test(advisory-gate): raise line budget 600→615 for #2008 edit-time merge
fix(dev-lead-fix-reviews): converge superseded dispositions before sk…
fix: count only trusted-author run markers in the stale-disposition d…
fix: honor an active rate-limit hold in the retry sweep, including the …
fix: count a pass from when it started in the #2008 stale-edit dedup …
fix: detect a throttled CodeRabbit code review even beside a security…
feat: implement issue #2008 — CodeRabbit's Security Architecture Revi…
Merge branch 'main' into dev-lead/issue-2017-20261002-1300
fix(bot): enhance docstrings for gate4 and cleanup functions to meet …
fix(reviews): make deferred-thread resolution work and recover on fai…
feat: implement issue #2045 — dev-lead: no deferred/out-of-scope outc…
fix(bot): enhance docstrings for gate4 and cleanup functions to meet …
feat: implement issue #2166 — Edited-after-disposition deadlock: fix-…