refactor(libsy): extract load_judge_config and drop reasoning fallback in judge verdict parsing - #204
Merged
Merged
Conversation
…k in judge verdict parsing Signed-off-by: Lin Jia <linj@nvidia.com>
linj-glitch
force-pushed
the
linj/switch-1054-llm-judge-changes
branch
from
July 30, 2026 17:56
59ea9c4 to
6577642
Compare
linj-glitch
changed the base branch from
linj/switch-1054-classifier-changes
to
main
July 30, 2026 17:57
WalkthroughChangesJudge evaluation flow
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/libsy/src/algorithms/llm_class.rs (1)
850-850: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the prepended system-message contract.
The count alone passes if the first message has the wrong role or prompt. Assert that message zero is
Role::Systemand equalsjudge.config.system_prompt.🤖 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 `@crates/libsy/src/algorithms/llm_class.rs` at line 850, Extend the assertions around judge_request.llm_request.messages to validate the prepended message itself: assert message zero has Role::System and its prompt/content equals judge.config.system_prompt, while retaining the existing length assertion.
🤖 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 `@crates/libsy/src/algorithms/llm_class.rs`:
- Line 850: Extend the assertions around judge_request.llm_request.messages to
validate the prepended message itself: assert message zero has Role::System and
its prompt/content equals judge.config.system_prompt, while retaining the
existing length assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c7b0fa6b-c8eb-46ca-a043-ba9a8640c536
📒 Files selected for processing (3)
crates/libsy/src/algorithms/llm_class.rscrates/libsy/src/algorithms/util.rscrates/libsy/src/algorithms/util/llm_judge.rs
eric-liu-nvidia
approved these changes
Jul 30, 2026
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.
Two related judge changes: extracts the prompt+schema loading logic into a shared load_judge_config helper (used by both the capability classifier and the escalation judge), and drops the reasoning-content fallback in parse_json_verdict. The fallback was added to handle gateways that return verdicts in reasoning blocks, but the judge is now configured to run without thinking, so the completion always carries the verdict — reading from reasoning was masking truncated replies instead of surfacing them as errors. Part 3 of breaking up PR #172.
Summary by CodeRabbit