[config] fix: constrain busy threshold range - #79
Conversation
|
Warning Review limit reached
More reviews will be available in 32 minutes and 40 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate 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 see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthrough
busy_threshold range enforcement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Code Review
This pull request restricts the busy_threshold configuration to accept only -1 or integers between 0 and 100 (inclusive) to ensure eco-safe utilization backoff. It updates the centralized validator, integrates it into the CLI, updates extensive documentation, and adds corresponding test coverage. Feedback suggests using a more specific exception class (typer.BadParameter instead of Exception) in the CLI threshold tests to avoid overly broad assertions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/test_cli_thresholds.py`:
- Around line 38-40: The threshold CLI test is asserting on a слишком broad
exception type, so tighten it to match the contract of
_validate_cli_busy_threshold(). Update the pytest.raises call in the busy
threshold test to expect typer.BadParameter instead of Exception, and keep the
existing error message match so the test verifies the intended validation path
in test_cli_thresholds.py.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 349f92e1-e164-4c14-89bf-0b8ea7c1bac5
📒 Files selected for processing (16)
AGENTS.mdREADME.mddocs/concepts/architecture.mddocs/guides/cli.mddocs/guides/mcp.mddocs/guides/python.mddocs/plans/busy-threshold-range.mddocs/reference/cli.mdsrc/keep_gpu/cli.pysrc/keep_gpu/utilities/session_config.pytests/cuda_controller/test_throttle.pytests/global_controller/test_contract.pytests/mcp/test_server.pytests/test_cli_service_commands.pytests/test_cli_thresholds.pytests/utilities/test_session_config.py
Summary
busy_thresholdto-1or inclusive0..100in the central validatorVerification
PYTHONPATH=$PWD/src pytest tests/utilities/test_session_config.py tests/test_cli_thresholds.py tests/test_cli_service_commands.py tests/mcp/test_server.py tests/cuda_controller/test_throttle.py tests/global_controller/test_contract.py -q-> 70 passed, 1 skippedPYTHONPATH=$PWD/src pytest tests -q-> 107 passed, 12 skippedPYTHONPATH=$PWD/src mkdocs build-> built successfully with existing Material/MkDocs and unnav'd docs noticespre-commit run --all-files-> passedgit diff --check-> passedLocal worker notes
101failed before the central validator fix, then passed after it.Summary by CodeRabbit
New Features
busy_thresholdhandling across the app to accept only-1or values from0to100.Bug Fixes
100being allowed and101being rejected.