eval: include structured results, run config, and summary in JSON output#2309
Merged
eval: include structured results, run config, and summary in JSON output#2309
Conversation
The eval JSON output now includes: - Run metadata: name, timestamp, duration, config (agent, judge model, concurrency, evals dir), and aggregate summary - Per-session eval_result with pass/fail, human-readable successes/failures, error, cost, and output tokens - Structured checks: size (actual vs expected), tool_calls (F1 score), and relevance (per-criterion pass/fail with judge reasoning) - Relevance results list ALL criteria with passed bool, not just failures Output format changes from a bare session array to a RunOutput wrapper. No changes to the session DB schema. Assisted-By: docker-agent
The LLM judge already generates a reason for every criterion (pass and fail), but CheckRelevance was discarding reasons for passed ones. Changes: - RelevanceResult now includes a Passed bool field - CheckRelevance returns []RelevanceResult (all criteria) instead of (passed int, failed []RelevanceResult) - populateEvalResult copies reasons for all criteria into the JSON output - The JSON output now shows reason on every criterion, not just failures Assisted-By: docker-agent
When a criterion check errors (context cancelled, judge API failure), the continue left results[i] as a zero-value RelevanceResult with empty Criterion. Pre-populate criterion names before the loop so every entry is well-formed regardless of errors. Addresses review feedback from #2309. Assisted-By: docker-agent
Contributor
Author
|
/review |
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
No issues found in the changed code. The PR properly refactors the eval JSON output format to include structured results, run configuration, and summary metadata. All changes are well-tested and error handling is appropriate.
Key changes reviewed:
RunOutputwrapper structure with metadata, config, and summaryCheckRelevancenow returns results for all criteria (passed and failed) with judge reasoning- Proper updates to all call sites and comprehensive test coverage
- Breaking change to JSON output format is documented in PR description
Assisted-By: docker-agent
Assisted-By: docker-agent
dgageot
approved these changes
Apr 2, 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.
What
The eval JSON output (
<run-name>.json) now includes everything that was previously only in the log file:eval_resultwith overall pass/fail, human-readable successes/failures, error, cost, output tokenschecks: size (actual vs expected), tool_calls (F1 score), and relevance (per-criterion pass/fail with judge reasoning)JSON output format change
The output changes from a bare session array to a
RunOutputwrapper:{ "name": "happy-panda-1234", "timestamp": "...", "duration": "42s", "config": { "agent": "...", "judge_model": "...", "concurrency": 8, "evals_dir": "..." }, "summary": { "total_evals": 5, ... }, "sessions": [ { "title": "LedgerLite Container", "evals": { ... }, "eval_result": { "passed": true, "successes": ["relevance 5/5"], "checks": { "relevance": { "passed": true, "passed_count": 5, "total": 5, "results": [ { "criterion": "Uses app.py as entrypoint", "passed": true, "reason": "..." }, { "criterion": "Keeps sample data optional", "passed": false, "reason": "..." } ] } } }, "messages": [...] } ] }Files changed
pkg/session/session.go— New types:EvalResult,EvalResultChecks,SizeCheck,ToolCallsCheck,RelevanceCheck,RelevanceCriterionResultpkg/evaluation/types.go—RunOutput,RunOutputConfig,Configfield onEvalRunpkg/evaluation/judge.go—CheckRelevancenow returns[]RelevanceResult(all criteria with reasons) instead of(passed int, failed []RelevanceResult)pkg/evaluation/save.go—populateEvalResult+ updatedSaveRunSessionsJSONpkg/evaluation/eval.go— UpdatedCheckRelevancecaller, setConfigonEvalRunNotes
eval_resultonly appears in the JSON output