Repository navigation
feat(always_on_agent_verifier): with use_trajectory, the agent judge searches every wake staged as files - #680
Open
sarah-chitty-1 wants to merge 8 commits into
Conversation
…searches every wake staged as files always_on_staging builds the run's files from its stored timeline and each wake's trajectory, matched by trajectory_url: wakes/wake_NNN.jsonl (what woke the assistant with the user's whole message, every tool call with input and result, its text, every app change, messages, nudges, reads), events.jsonl, triggers.jsonl and index.md (actions and messages with file:line). Any line too long to read whole keeps a preview and moves its long fields to wakes/results/. index.md's write actions are calls of a tool that made one of the wake's app changes (the changes' actors), or, when the apps keep no change log, a guess from the tool name; the index says which. Missing or unreadable trajectories and turns compaction didn't shrink are recorded and logged. The verifier accepts use_trajectory with the agent judge only, writes the files concurrently, adds a prompt note on reading them, records the staging and what each judge call read (judge_reads), and gives the judge only Bash and Read of its own tools (builtin_tools only), with no peer-agents tools (peer_tools false): no helper agents, web, writes or messaging other agents. Its defaults: 2400 s and 400 turns per judge call, one timeout retry, at most 3 batches at once. Without a stored timeline it falls back to rubrics_verifier's per-turn loading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1
force-pushed
the
sarahchitty/fd-5840-verifier-hooks
branch
from
November 14, 2026 01:09
a87e0b4 to
24c5385
Compare
sarah-chitty-1
force-pushed
the
sarahchitty/fd-5840-agent-judge
branch
from
November 14, 2026 01:09
1e2db49 to
1ccdf35
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ites in the index, compare trigger times parsed, find wakes in text results; log a count, not every untrimmed trajectory Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines
+180
to
+181
| def judge_agent_config(self) -> dict: | ||
| return {"builtin_tools": {"only": list(JUDGE_TOOLS)}, "peer_tools": False} |
There was a problem hiding this comment.
judge_agent_config sends Claude Code's tool names to every agent judge. If a task selects Codex or OpenCode through judge_a2a_agent_id or agent_name, those agents accept builtin_tools but reject Bash and Read. Codex uses names such as exec_command; OpenCode uses lowercase bash and read.
The config request fails before grading starts, even without use_trajectory. Choose the tool selection from the judge's supported names instead of sending Claude Code names unconditionally.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/task_step/task_steps/verifiers/always_on_agent_verifier.py
Line: 180-181
Comment:
**Other judges cannot grade**
`judge_agent_config` sends Claude Code's tool names to every agent judge. If a task selects Codex or OpenCode through `judge_a2a_agent_id` or `agent_name`, those agents accept `builtin_tools` but reject `Bash` and `Read`. Codex uses names such as `exec_command`; OpenCode uses lowercase `bash` and `read`.
The config request fails before grading starts, even without `use_trajectory`. Choose the tool selection from the judge's supported names instead of sending Claude Code names unconditionally.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.…g line in its wake when the trajectory recorded it 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.
What and why
Third of three stacked PRs (Linear FD-5840); it builds on #679. The always-on process judge can now read every tool call of every wake.
The problem.
always_on_agent_verifiergrades from the user's chat and a summary of each wake, and refusesuse_trajectory.What this PR adds.
always_on_staging.pybuilds the run's files from its stored timeline and each wake's trajectory. Each trajectory is matched to its wake by the timeline'strajectory_url, never by list position. The files:wakes/wake_NNN.jsonl, one event per line. First what woke the assistant, with the user's whole message. Then every tool call with its input and result, and the assistant's own text. Then the rest of the wake in time order: every app change, its closing reply, messages to the user, nudges, and the user's reads.events.jsonl: every wake in one file.triggers.jsonl: every trigger firing.index.md: a block per wake with its time, what woke it, the user's message, its write actions and messages (each withfile:line), and errors.wakes/results/. Lines longer than 1,800 characters there are split across lines, nothing dropped (a JSON file that needed it becomes.txt).assistant_thinkingline in its wake.index.mdsays which method it used. In a run with change logs, a write-sounding call of a tool no change names (an app without a log) is listed as a "possible action".triggers.jsonlplaces each firing after the right wake by comparing parsed times; the staging log gives a count of untrimmed trajectories, not the list.always_on_agent_verifier:use_trajectorywith the agent judge only.index.md, search, then read with an offset; later actions replace earlier ones; where the user's messages are; cite wake and call numbers; what counts as the assistant's own act.judge_reads, counting files read through Read, Grep or Bash).builtin_tools: {"only": ["Bash", "Read"]}) and no peer-agents tools (peer_tools: false): no helper agents, no web, no writes, no messaging other agents. Its CLI command is--tools Bash,Read --strict-mcp-configwith no--mcp-config.Re-grade of a real run
Silent Week (
psi-ts-rw-silent-week-always-on-ab4d9621782ac6f6: 109 wakes, 3,586 app changes) was re-graded locally. The data was read-only from the hub. The judge was the Claude Code CLI on Opus 5.5 with 1M context, run with the agent's own command builder. The criteria were ML's 8 original process criteria.index.md, made one Python pass over every wake's tool calls, then opened wakes 9, 11, 18, 22, 59, 60, 71, 72, 75 and 80.events.jsonlortriggers.jsonl.Then the full path: the judge deployed the normal way (the Claude Code agent in local Docker, files staged into its sandbox, settings sent through agent-config and read back), ML's original criteria:
psi-ts-craftweb-holiday-rush-always-on-0dc41c6159628433), 4 batches of 4, 3 at oncepsi-ts-rw-fender-bender-always-on-ef40b3a3fb2082d1, cut off at wake 80)JudgeTimeoutErrorThe read-back config showed
max_turns: 400andtimeout_seconds: 2400. Those runs exposed peer-agents, web and write tools on the judge, which this PR now removes (above).Backward compatibility
use_trajectorygrades from the same prompt as before, with these default changes:judge_timeout_seconds: 1000anduse_agent_judge: false, so they grade as today until their task files turn this on.How it was tested
test_always_on_staging.py, on a redacted recorded timeline and recorded trajectories. It covers:index.md'sfile:linepointing at the right line;events.jsonlandtriggers.jsonl;judge_readsacross Read, Grep, Bash loops and globs.test_always_on_agent_verifier.pycovers an end-to-end grade staged into a fake judge sandbox, the fallback without a timeline, a run that turns the agent judge off being refused, and the defaults.tst/unit/agents/claude_code/test_always_on_judge_config.pychecks that the judge's settings are ones the Claude Code agent's card takes.pytest tst/unit/task_step tst/unit/agents/claude_codepasses (3,372 passed);ruff checkis clean.tst/unit: 3 failures, intest_disk_recipeandtest_docker_image_github_clone. They also fail on main.🤖 Generated with Claude Code
The PR should not merge until Codex and OpenCode judges can accept the tool settings.
Fix with agent prompt
Summary
Adds searchable files for grading always-on runs with
use_trajectory.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Timeline[Stored timeline] --> Stage[Match trajectories to wakes] Trajectories[Wake trajectories] --> Stage Firings[Trigger firings] --> Stage Stage --> Files[Index and staged files] Files --> Judge[Agent judge] Judge --> Grade[Criterion results] Judge --> Reads[Recorded file reads]Reviews (10) · Last reviewed commit: "Merge #679 into #680" · Reviewed by Greptile