Conversation
Pre-compute diff lines and file count in pr-context.md, write to pr-size.txt. The PR review prompt now uses diff lines to decide: - Under 200 lines: review directly (no sub-agents) - 200-800 lines: spawn 2 sub-agents (A-Z, Z-A) - Over 800 lines: spawn 3 sub-agents (A-Z, Z-A, largest first) This keeps all logic in the prompt (readable, no indirection) and uses diff lines instead of file count as the heuristic, which better captures actual review complexity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
|
||
| # Compute PR size metrics for review fan-out decisions | ||
| FILE_COUNT=$(jq 'length' /tmp/pr-context/files.json) | ||
| DIFF_LINES=$(wc -l < /tmp/pr-context/pr.diff | tr -d ' ') |
There was a problem hiding this comment.
[MEDIUM] Diff-size fallback misclassifies PRs when full diff fetch fails
DIFF_LINES is derived only from /tmp/pr-context/pr.diff. In the failure path just above, gh pr diff can fail and the script intentionally creates an empty file (: > /tmp/pr-context/pr.diff), which forces DIFF_LINES=0 and classifies the PR as "small" even when the actual patch set is large. This defeats the fan-out logic introduced in this PR and can under-review large PRs; please fall back to counting lines from files.json patches when pr.diff is empty.
Summary
pr-contextand writespr-size.txtas{N} files, {M} diff lines.pr-size.txtas input.Supersedes #510 with a simpler approach.
Test plan
make compilesucceeds