fix(skills): flip PR to ready before waiting on CodeRabbit to avoid a draft deadlock#3976
Conversation
… draft deadlock CodeRabbit never reviews a draft PR. The pull-request skill's monitor loop could enter (or continue) the CodeRabbit/threads wait while the PR was still draft, deadlocking silently — observed 2026-07-16: a converging PR sat in draft with CI green and the CodeRabbit check pending indefinitely, until manually un-drafted. - SKILL.md §5: emphasize the ordering invariant — `gh pr ready` MUST run as soon as draft CI is green, before section 6 starts waiting on any review signal. - SKILL.md §6 / monitor-loop.md: add a belt-and-braces draft guard at the top of every poll pass — if `isDraft: true` and CI is green, flip to ready immediately. Covers a loop started before the flip, or a rebase/force-push that reverted the PR back to draft. Closes #3956 Claude-Session: https://claude.ai/code/session_01WfNC8bt1TgL4AsiYgCEGup
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe pull-request skill now requires marking a PR ready immediately after draft CI becomes green, before waiting for review signals. The autonomous monitor loop also rechecks draft status and readiness on each pass. ChangesDraft readiness ordering
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/pull-request/references/monitor-loop.md:
- Around line 55-56: Update the monitor loop’s draft-and-CI handling so that
when step 1 observes CI becoming green after initially being red, it returns to
or re-executes the draft guard from step 0 before proceeding to mergeability,
grace, or review checks. Preserve the existing no-op behavior while CI remains
red and ensure a draft PR is converted on the next pass.
- Around line 46-52: Update the CI_GREEN calculation in the monitor loop to
require a non-empty statusCheckRollup before evaluating whether all checks
succeeded. Preserve the existing SUCCESS/state handling and ensure an empty
check list evaluates to false, preventing gh pr ready from running before any
check completes.
- Around line 50-52: Update the draft-to-ready branch in the monitor loop so
failures from gh pr ready "$PR" are detected and handled before entering the
review-wait path. Stop the loop or retry the command on failure, and continue
only after the PR is successfully marked ready.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: d1c15528-49b6-4174-837d-915a781430be
📒 Files selected for processing (2)
.claude/skills/pull-request/SKILL.md.claude/skills/pull-request/references/monitor-loop.md
… and accept neutral/skipped Claude-Session: https://claude.ai/code/session_01WfNC8bt1TgL4AsiYgCEGup
…ter CI goes green Claude-Session: https://claude.ai/code/session_01WfNC8bt1TgL4AsiYgCEGup
Summary
/pull-requestskill's monitor loop — flip the PR to ready (gh pr ready <n>) as soon as draft CI is green, before any CodeRabbit/threads wait. Also added a belt-and-braces per-pass draft-guard (step 0 in the monitor loop,references/monitor-loop.md§6-guard) that flips ready if a pass ever observesisDraft: truewith CI green.Scope
.claude/skills/pull-request/SKILL.md,.claude/skills/pull-request/references/monitor-loop.mdValidation
npm run lint(no runtime code touched; lint clean)npm test(no runtime code touched; no test impact)Guardrails check
.env*,secrets/**, keys, tokens)Notes for reviewers
https://claude.ai/code/session_01WfNC8bt1TgL4AsiYgCEGup
Summary by CodeRabbit