Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Move the shared judge implementation, regression tests and API docs to #738. The operational-data template retains its configured judge budget and depends on that fix before release.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffd244a96d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| or data.get("criterion_status") not in ("MET", "UNMET") | ||
| or not isinstance(data.get("explanation"), str) |
There was a problem hiding this comment.
Reject empty verdict explanations
When the judge returns {"criterion_status":"MET","explanation":""} (or whitespace only), this condition accepts it and awards the score even though the new public contract requires a verdict with an explanation. Validate that the explanation remains non-empty after stripping whitespace so an unsupported judgment receives the documented repair attempt and ultimately fails if unrepaired.
AGENTS.md reference: AGENTS.md:L71-L75
Useful? React with 👍 / 👎.
|
Closing in favor of #719, which fixes the NOT MET misread while keeping the judge's prose-verdict contract. |
An empty or malformed LLM judge response can currently become UNMET, which awards credit when grading a negative criterion. Explicit max_tokens values are also silently discarded, leaving every judgment at 1024 tokens.
Forward the configured budget, reject truncated responses, and require a structured MET/UNMET verdict with a non-empty explanation. Malformed responses get one format-repair attempt before raising a grading error.
Extracted from #731 into three files: the shared judge, its regression tests, and its API docs. This PR targets main; #731's operational-data template depends on it for its 16K judge budget.
Validation: 95 grader tests pass on both Python 3.11 and 3.12; Ruff lint/format and grader type checks pass. Tests use mocked gateway responses.
The six blank-explanation regression cases fail before this follow-up and pass after it. A temporary checkout combining this PR with #726's existing Claude compatibility fix passes the full SDK suites on Python 3.11 and 3.12 (1,640 passed each, six skipped, 27 integration cases deselected), both full type checks, and 80.51% coverage. The Claude fix remains in #726.
Note
Medium Risk
Grading semantics change: malformed or truncated judge output now fails the grade rather than defaulting to UNMET, which fixes negative-criterion bugs but may surface errors in tasks that previously limped through.
Overview
LLMJudgeGradernow accepts amax_tokensargument (default 1024), forwards it to each per-criterion gateway call, rejects non-positive values, and surfaces the budget on the parentSubScoremetadata. Responses that hit the token limit (finish_reason == "length") raise aRuntimeErrorinstead of being scored.Verdict handling is stricter: the judge must return JSON with
MET/UNMETand a non-empty explanation. The old tolerant fallback (e.g. scanning for "MET" in free text, which could silently score UNMET and wrongly reward negative criteria) is removed; invalid output gets one format-repair follow-up, thenValueError. Criterioninfonow includesattempts, and the system prompt requires explanations.Docs in
graders.mdxdescribemax_tokensand the new error behavior. Regression tests cover repair flow, truncation, invalid payloads, and budget wiring.Reviewed by Cursor Bugbot for commit d4c5643. Bugbot is set up for automated code reviews on this repo. Configure here.
CI sequencing: the current main branch still has the Anthropic 2.1 message-constructor issue fixed in #726. This PR's lint-ty job reports the same five errors in the unchanged Claude adapter. Merge #726, update this branch from main, then merge this grader fix before #731. The grader-specific tests and type checks pass.