Repository navigation
feat(verifiers): read coding-agent CLI trajectories in the judge action log - #223
Open
kaihackney-scale wants to merge 3 commits into
Open
kaihackney-scale wants to merge 3 commits into
kaihackney-scale wants to merge 3 commits into
Conversation
…on log
The direct judge's action log (compaction_type=screenshot, trajectory_text=action_log)
only parsed OTel spans. Trajectories from coding-agent CLIs (stream-json rows) and
OpenCode (part events) produced an empty transcript, so a direct judge on those runs
graded without seeing a single tool call.
- transcript_from_raw detects the format: OTel spans (unchanged), stream-json rows
(tool_use paired with tool_result by id; is_error recorded as {"error": ...}),
OpenCode tool/text parts (re-emitted parts merged; random mcp_<hex>_ prefix dropped).
JSON-in-text tool results are decoded in the two new parsers.
- action_log takes max_args_chars / max_result_chars; TrajectoryFilter gains
action_log_max_args_chars / action_log_max_result_chars (defaults unchanged at
110 / 160) and rubrics_verifier passes them through.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…read transcript_from_raw returned an empty transcript for JSON in no format it reads, so a direct judge with trajectory_text=action_log graded an empty log without any sign that it could not see the run. Transcript now records its source format (otel / stream-json / opencode, empty, malformed), and the verifier raises when the action log is asked to read unrecognised JSON. Text that is not JSON at all stays a failed run, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esults
- An OpenCode tool in status "error" with its reason in `output` (no
`error` field) rendered as {"error": null}. Fall back to `output`.
- A stream-json result of "[]" or "{}" decoded to an empty collection and
was then dropped as no result, so the judge could not tell a search
with no matches from a call with no recorded result. Only an empty
text result now counts as none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Why
The direct (non-agent) judge's action log (
compaction_type: screenshot,trajectory_text: action_log) only parsed OTel spans. Trajectories from coding-agent CLIs (stream-json rows:system/assistant/user/result) and from OpenCode (partevents) produced an empty transcript. A direct judge on those runs therefore graded without seeing a single tool call. The fixed per-call cuts (110 chars of arguments, 160 of result) are also too small for MCP tool traffic.What
transcript_from_rawdetects the format:_transcript_from_otel.tool_useblocks are paired with theirtool_resultby id;is_errorresults become{"error": ...}; assistanttextblocks become messages; the closingresultrow is skipped (the judge already gets the final response).toolparts (input, then output or error) andtextparts; a part re-emitted as its state advances keeps its first position and its latest state; the randommcp_<hex>_tool prefix is dropped.{"result": "{\"id\": ...}"}otherwise renders as mostly escape characters.action_logtakesmax_args_chars/max_result_chars.TrajectoryFiltergainsaction_log_max_args_chars/action_log_max_result_chars(validated likeaction_log_max_lines, serialized into_dict/from_dict). Defaults stay 110 / 160, so existing tasks render exactly as before.rubrics_verifierpasses them through.rendered_actionat the default cut, as before.Transcriptrecords the format it was read from (source). Whentrajectory_text=action_logand the trajectory is JSON in no format the action log reads, the verifier raises instead of handing the judge an empty log. Text that is not JSON at all stays a failed run, as before.Testing
tst/unit/task_step/verifiers/judge_utils/test_frame_selection_cli_formats.pycovers stream-json pairing (errors, images, orphan results), OpenCode parts (status updates, error, prefix), nested-JSON decoding, the new cuts, and that unrecognised lists still give an empty transcript. Its 4 behaviour tests fail onmainand pass here.test_rubrics_verifier_per_criterion.py: the new filter fields round-trip and are validated, and a stream-json trajectory reaches the direct judge's prompt as an action log at the configured cuts.[]) still reaches the judge. With the guard disabled, its test fails.outputkeeps the reason, and a[]stream-json result stays apart from no result. Each test fails with its fix reverted.tst/unit/task_step/verifiers/: 359 passed locally. The full suite is left to CI: the local environment lacks some newer dependencies.Why it matters
On a sample of real MCP-agent runs, a direct judge reading this action log agreed with the agent judge on about 92% of criteria, at a fraction of the latency.
No task's configuration changes in this PR.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; both previous findings are fixed and no new blocking issues were found.Summary
The PR adds coding-agent CLI and OpenCode tool calls to the direct judge’s action log.
No new actionable issues were found. Checks were based on code and tests; tests were not run during this review.
Reviews (2) · Last reviewed commit: "fix(verifiers): keep OpenCode error reas..." · Reviewed by Greptile