Repository navigation
fix(evaluation): preserve full tool results in judge transcripts - #4771
Merged
Merged
Conversation
Remove the implicit 500-byte tool-result cutoff so relevance judges can assess the same evidence recorded for the agent. Cover boundary lengths, tail and middle evidence, UTF-8, and large outputs. Closes #4770 Assisted-By: docker-agent Signed-off-by: melmennaoui <mohamed.elmennaoui@docker.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change to preserve complete tool responses in the relevance judge’s transcript.
No open issues 🎉
What changed in this PR
Fixes #4770 by preserving complete tool responses in the relevance judge’s transcript, so grading can use evidence beyond the former 500-byte cutoff.
Changes:
- Removes tool-response truncation without changing agent execution or scoring logic.
- Adds regression coverage for boundary lengths, middle and trailing evidence, UTF-8, large outputs, and transcript ordering.
- Accepts larger judge inputs as an explicit tradeoff for preserving evidence.
| File | Description |
|---|---|
pkg/evaluation/eval.go |
Preserves full tool responses in chronological judge transcripts. |
pkg/evaluation/eval_test.go |
Replaces truncation expectations and tests exact evidence preservation and ordering. |
Review effort: Balanced
trungutt
approved these changes
Oct 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.
Summary
Closes #4770.
Why
The agent can correctly report evidence beyond byte 500 while the judge receives only a prefix and calls that evidence fabricated. Conversely, an error beyond the cutoff can be hidden from grading. Saved sessions and judge evidence should not disagree because of an implicit formatter limit.
This fixes transcript construction only: no changes to agent execution, rubric, tool-call matching, size checks, or score aggregation.
Tradeoff
Verbose tool results now produce larger judge inputs, potentially increasing tokens, cost, latency, or context-window pressure. This PR deliberately does not replace the arbitrary limit with another lossy cutoff or an LLM summary. A future explicit context-budget policy should preserve relevant evidence or surface insufficient evidence rather than silently turning omitted content into grading failures. This change does not claim an observed pass-rate improvement; measuring that requires regrading frozen transcripts.
Validation
task test— passed.task build— passed.go test ./pkg/evaluation -count=1— passed.go test -race ./pkg/evaluation -count=1— passed.golangci-lint run --allow-parallel-runners --new-from-rev=HEAD— 0 new issues (run before committing, against the main baseline).go run ./lint .— 2,759 files inspected, no offenses.go mod tidy --diffandgit diff --check— clean.task lintis blocked by three existingerrcheckfindings in unchangedpkg/tools/lifecycle/supervisor_test.goat lines 376, 777, and 1075, using golangci-lint 2.15.0. Those files are not modified here.No paid model calls or Docker eval runs are needed for these tests.