GH#3821: Add daily PR creation cap to prevent CodeRabbit quota exhaustion#3822
GH#3821: Add daily PR creation cap to prevent CodeRabbit quota exhaustion#3822marcusquinn merged 1 commit intomainfrom
Conversation
… (GH#3821) Add DAILY_PR_CAP (default 5) to pulse-wrapper.sh that counts open PRs created today (UTC) per repo during prefetch_state(). When the cap is reached, the pre-fetched state includes a clear 'DAILY PR CAP REACHED' directive telling the pulse LLM not to dispatch new workers for that repo. This prevents the supervisor from creating unlimited PRs per day, which exhausts CodeRabbit's daily review quota. Changes: - Add DAILY_PR_CAP config variable with _validate_int validation - Add createdAt to PR fetch fields in prefetch_state() - Increase PR fetch limit from 20 to 100 for accurate daily counting - Add Daily PR Cap section to pre-fetched state output per repo - Log when cap is reached Closes #3821
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
WalkthroughModified the pulse-wrapper script to enforce a daily PR creation cap of 5 PRs per repository. The script now retrieves PR creation timestamps during data collection, computes the remaining daily quota per repo, and signals when the cap is reached to halt worker dispatch. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Mar 7 23:49:59 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.agents/scripts/pulse-wrapper.sh (1)
420-425: Consider adding timezone clarification to the output.The cap logic correctly uses UTC (
date -u), but the output message on line 433 says "today (UTC)" which is helpful. However, if a user is debugging near midnight in their local timezone, they might be confused why the count differs from their local perception of "today."This is informational only — the current implementation is correct.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/scripts/pulse-wrapper.sh around lines 420 - 425, The output can be clearer about which "today" is used: update the message that currently prints "today (UTC)" to explicitly show both the UTC date and the local date to avoid confusion; compute local_today with date +%Y-%m-%d (in the same scope where today_utc and daily_pr_count are set) and include both today_utc and local_today in the user-facing message that references "today (UTC)" so users see "UTC: <today_utc>, Local: <local_today>" alongside daily_pr_count (variables to update: today_utc, daily_pr_count and the output string that mentions "today (UTC)").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.agents/scripts/pulse-wrapper.sh:
- Around line 420-425: The output can be clearer about which "today" is used:
update the message that currently prints "today (UTC)" to explicitly show both
the UTC date and the local date to avoid confusion; compute local_today with
date +%Y-%m-%d (in the same scope where today_utc and daily_pr_count are set)
and include both today_utc and local_today in the user-facing message that
references "today (UTC)" so users see "UTC: <today_utc>, Local: <local_today>"
alongside daily_pr_count (variables to update: today_utc, daily_pr_count and the
output string that mentions "today (UTC)").
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ffaedaa5-4472-4d39-aa37-d3322baf0cc5
📒 Files selected for processing (1)
.agents/scripts/pulse-wrapper.sh



Summary
DAILY_PR_CAP(default 5) topulse-wrapper.shthat counts open PRs created today (UTC) per repo during state prefetchDAILY PR CAP REACHEDdirective telling the pulse LLM not to dispatch new workers for that repoHow it works
DAILY_PR_CAPconfig variable (env-overridable, validated as integer >= 1)prefetch_state(), the existing PR fetch now includescreatedAt(no extra API call)createdAtstarts with today's UTC dateDO NOT dispatchtextChanges
.agents/scripts/pulse-wrapper.sh— 30 insertions, 3 deletions (1 file only)Closes #3821
Summary by CodeRabbit
Release Notes