Repository navigation
Support image evidence in DecisionJudge - #3269
Merged
Merged
Conversation
xeophon
marked this pull request as ready for review
November 24, 2026 20:18
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Adds opt-in image evidence and batched grading through the existing evaluation endpoint, with compact traces and usage recording. Existing defaults remain unchanged, and the caller-controlled additions present no obvious material risk requiring human judgment. You can add or adjust custom eligibility rules. Learn more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ordered image evidence to the native
DecisionJudge. Callers can passimages=[...]toevaluate(), or configureimages_fieldwhen the judge scores a task data field. The evaluations API receives the original image data URLs in its top-levelimagesfield.Image traces record the count and verdict without copying image bytes. Callers grading large artifacts can pass compact
trace_statemetadata. A malformed score raisesDecisionScoreErrorafter the judge call and usage are recorded, so callers can retry that verdict independently.The native
evaluate_batch()method scores up to 64 named questions per request with the same state and images. It returns scores in input order and records usage once for each batch.This supports the visual JobBench and APEX grading paths in PrimeIntellect-ai/prime-envs#1100.
Verification
Note
Add image evidence support to
DecisionJudgescoring and evaluationDecisionJudgeConfig.images_fieldto name a task field holding image data URLs.DecisionJudge.scoreforwards those images to evaluation and raisesValueErrorif the field is not a list of strings.DecisionJudge.evaluateto delegate to a shared_evaluate_questionshelper that attaches image data URLs to requests, batches up to 64 questions per request, and returns scores in question order.DecisionScoreErrorfor invalid, missing, boolean, or out-of-range grades; usage is recorded with token counts defaulting to zero.DecisionJudge.evaluate_batchnow rejects a string in place of a prompt sequence.scoreraisesValueErrorwhen the configuredimages_fieldtask attribute is missing or malformed; boolean grade scores now raiseDecisionScoreErrorinstead of being accepted.Macroscope summarized 4790d43.
Note
Medium Risk
Changes the core decision-judge request/response handling and scoring errors used for visual grading paths; malformed API responses now fail with a new exception type while still recording billable usage.
Overview
Extends
DecisionJudgeso grading can include ordered image data URLs on evaluation requests, either via new optionalimages/ configimages_fieldon tasks, or shared across many criteria in one call.evaluateand taskscorenow route through shared_evaluate_questions, which can post multiple named score questions per request. Newevaluate_batchscores up to 64 prompts per API round with the same state and images, returning normalized scores in input order. Invalid or out-of-range grades raiseDecisionScoreErrorinstead of a genericValueError, while usage and trace logging still run in afinallyblock.Tracing is tightened when images or
trace_stateare used: logged requests drop raw image payloads (recordingimage_countinstead), optional compact state replaces full artifacts in traces, and responses loganswersonly when providers might echo large state or image data. New unit tests cover image order, compact traces, malformed grades, and batch chunking at the 64-question boundary.Reviewed by Cursor Bugbot for commit 4790d43. Bugbot is set up for automated code reviews on this repo. Configure here.