feat(judge-feedback-batch): expose concurrency in job params#1544
Conversation
Add an optional `concurrency` field to JudgeFeedbackBatchJobParams and forward it to JudgeFeedbackBatchRunner.run. Null keeps the runner's mode-aware default (5 when generating outputs, 25 when judging existing ones); values below 1 are clamped to 1 by the runner. Regenerated api_schema.d.ts and added a param-forwarding test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019w3CFeeewrMyMRdTv3SgQm
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds an optional ChangesJudge Feedback Batch Concurrency
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 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.
Code Review
This pull request introduces an optional concurrency parameter to the JudgeFeedbackBatchJobParams model, allowing users to control the maximum number of items judged in parallel, and forwards this parameter to the batch runner. It also adds a corresponding unit test and updates the TypeScript API schema definitions. The reviewer suggests enforcing validation at the Pydantic level using ge=1 instead of silently clamping values below 1 in the runner.
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.
🧹 Nitpick comments (1)
app/desktop/studio_server/jobs/workers/judge_feedback_batch.py (1)
39-44: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueConsider validating
concurrencyat the schema level.The field accepts any
int, including 0 or negative values, which the runner silently clamps to 1 (perjudge_feedback_batch_runner.py'sconcurrency = max(1, concurrency)). Adding agt=0constraint would surface invalid input explicitly via Pydantic validation instead of silent clamping downstream.♻️ Optional validation tightening
concurrency: int | None = Field( default=None, description="Max items judged in parallel by the runner. Leave null to use the runner's " "default (5 when generating fresh outputs, 25 when judging existing ones). Values below 1 " "are clamped to 1 by the runner.", + gt=0, )🤖 Prompt for 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. In `@app/desktop/studio_server/jobs/workers/judge_feedback_batch.py` around lines 39 - 44, The JudgeFeedbackBatch schema currently allows non-positive concurrency values and relies on downstream clamping in judge_feedback_batch_runner, so tighten validation at the model level. Update the concurrency Field in JudgeFeedbackBatch to require a value greater than 0, so invalid inputs are rejected by Pydantic before reaching the runner instead of being silently corrected. Use the existing concurrency attribute in JudgeFeedbackBatch as the place to apply the constraint.
🤖 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.
Nitpick comments:
In `@app/desktop/studio_server/jobs/workers/judge_feedback_batch.py`:
- Around line 39-44: The JudgeFeedbackBatch schema currently allows non-positive
concurrency values and relies on downstream clamping in
judge_feedback_batch_runner, so tighten validation at the model level. Update
the concurrency Field in JudgeFeedbackBatch to require a value greater than 0,
so invalid inputs are rejected by Pydantic before reaching the runner instead of
being silently corrected. Use the existing concurrency attribute in
JudgeFeedbackBatch as the place to apply the constraint.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4016004b-0836-4b9c-a206-7e27d6206427
📒 Files selected for processing (3)
app/desktop/studio_server/jobs/workers/judge_feedback_batch.pyapp/desktop/studio_server/jobs/workers/test_judge_feedback_batch.pyapp/web_ui/src/lib/api_schema.d.ts
📊 Coverage ReportOverall Coverage: 92% Diff: origin/integration/auto-mode-e2e...HEAD
Summary
|
Add ge=1 to the concurrency param so invalid input returns a 422 up front (consistent with max_samples / stop_after_failures) instead of being silently clamped by the runner. Update the description, regenerate api_schema.d.ts, and add a validation test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019w3CFeeewrMyMRdTv3SgQm
What
Add an optional
concurrencyfield toJudgeFeedbackBatchJobParamsand forward it toJudgeFeedbackBatchRunner.run()inside the job worker.Why
The runner already accepts a
concurrencyargument (bounding how many items are judged in parallel per chunk), but the background job worker calledrunner.run(...)without it — so callers of the job API could never tune parallelism and were always stuck on the runner's default.Details
concurrency: int | None = NoneonJudgeFeedbackBatchJobParams, with a field description. Null keeps the runner's mode-aware default (5 when generating fresh outputs, 25 when judging existing ones); values below 1 are clamped to 1 by the runner.concurrency=params.concurrencytorunner.run(...).api_schema.d.ts(the param is part of the jobs API request body).None) is forwarded to the runner.Checks
pyteston the worker tests: 9 passedty check, andcheck_schema.sh: all pass🤖 Generated with Claude Code