Repository navigation
fix(judge): harden agent_judge JSON output prompt - #260
Merged
zpzjzj merged 1 commit intoSep 18, 2026
Merged
Conversation
…fixes
Agentic judges (e.g. qodercli) sometimes close their final message with
natural-language prose ("I ...") instead of the required JSON object. The
decoder strips a leading code fence but no leading prose, so the response
fails with "invalid character 'I' looking for beginning of value" and
AgentJudge.Evaluate burns an extra full model call on the correction retry.
Extract a shared appendStrictOutputRules contract and emit it near the end of
both the first-attempt prompt (buildJudgePrompt) and the correction prompt
(buildAgentJudgeCorrectionPrompt), so the two state the output rules verbatim
and cannot drift. This ports the exact field-casing rule that previously lived
only in the correction prompt into the first attempt, requires the final
message to be JSON-only even after tool use, and reconciles the contradictory
Markdown-fence wording between the two prompts.
Refs alibaba#259
3 tasks
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.
Summary
I ...from triggering a full correction retry.Fixes #259
Test plan
go build ./...go test ./internal/judge/