[mcp, cli] fix: validate custom job ids - #81
Conversation
|
Warning Review limit reached
More reviews will be available in 54 minutes and 35 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 (13)
📝 WalkthroughWalkthroughIntroduces a centralized Changesjob_id Validation Centralization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
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 introduces centralized validation for custom job_id values across the service, ensuring they are URL-path-safe non-empty strings before any session state changes occur. It updates the server, CLI, REST endpoints, and documentation to enforce this contract, backed by a comprehensive suite of new tests. The review feedback highlights two important improvements: first, trimming the job_id in validate_job_id to match the design plan's requirement, and second, replacing a runtime assert statement with an explicit conditional check to prevent validation bypasses when Python is run with optimizations.
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.
fc5b5f7 to
f0ffb45
Compare
Summary
job_idvalidation so onlyNone/omitted means generated or all-sessions--job-idin CLI service commands so service validation rejects itVerification
PYTHONPATH=$PWD/src pytest tests/utilities/test_session_config.py tests/mcp/test_server.py tests/mcp/test_http_api.py tests/test_cli_service_commands.py -q-> 130 passedPYTHONPATH=$PWD/src pytest tests -q-> 173 passed, 12 skippedPYTHONPATH=$PWD/src mkdocs build-> passed, with existing MkDocs Material warning and un-nav docs noticespre-commit run --all-files-> passedgit diff --check-> passed before commitLocal review
--job-idforwarding.Summary by CodeRabbit
New Features
--job-idvalues are now passed through correctly in CLI status/stop commands.Bug Fixes
400errors for malformed paths or invalid IDs.null/omitted IDs are handled consistently as generated IDs or all-sessions actions, depending on the command.Documentation