feat(v1): seat replay — pin any env agent to a finished run's traces - #2118
feat(v1): seat replay — pin any env agent to a finished run's traces#2118mikasenghaas wants to merge 3 commits into
Conversation
AgentConfig.replay points a seat at a saved run dir (or traces.jsonl): _ReplayEpisodeAgent revalidates the saved trace for each task and re-stamps it with the seat's standing instead of sampling, so the other seats iterate against fixed work — e.g. re-judging saved solver rollouts through the real agentic-judge env: --env.solver.replay <run>. A single-seat run matches any requested seat name. A replayed seat runs no model and leaves no runtime state, so envs that need the seat's box refuse it (agentic-judge requires --env.shared-runtime false and says so at construction). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| return trace | ||
|
|
||
|
|
||
| class ReplayStore: |
There was a problem hiding this comment.
🟡 Medium v1/agent.py:435
ReplayStore keys each seat's saved traces by task name/idx only, so when the source run produced multiple rollouts for the same task (e.g. num_rollouts > 1), line 455 silently overwrites every earlier trace for that key with the last one. Each replay episode for that task then receives the same single last trace regardless of which source rollout it should correspond to, duplicating one sample and discarding the rest — biasing re-grading and rollout-group statistics. Consider keying by a per-rollout discriminator (e.g. an episode index) in addition to task name/idx, or preserving all traces per key and selecting by episode.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @verifiers/v1/agent.py around line 435:
`ReplayStore` keys each seat's saved traces by task name/`idx` only, so when the source run produced multiple rollouts for the same task (e.g. `num_rollouts > 1`), line 455 silently overwrites every earlier trace for that key with the last one. Each replay episode for that task then receives the same single last trace regardless of which source rollout it should correspond to, duplicating one sample and discarding the rest — biasing re-grading and rollout-group statistics. Consider keying by a per-rollout discriminator (e.g. an episode index) in addition to task name/`idx`, or preserving all traces per key and selecting by episode.
…ield moves to configs/agent.py, records don't migrate across TRACE_VERSION Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s a replayed solver Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Parking this for now — focus is on the agentic judge (#2109); branch stays for later pickup. |
| for t in traces: | ||
| seat = ((t.get("agent") or {}).get("name")) or "agent" | ||
| data = (t.get("task") or {}).get("data") or {} | ||
| key = data.get("name") or f"idx:{data.get('idx')}" |
There was a problem hiding this comment.
🟡 Medium v1/agent.py:717
When two tasks in the dataset share the same non-empty name but have different idx values, ReplayStore indexes traces by name alone, so the second task's trace overwrites the first's in by_seat. Both tasks then replay the second task's trace — the first task's saved trace is silently lost. The lookup key should include idx (or another unique identifier) so tasks with the same name don't collide.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @verifiers/v1/agent.py around line 717:
When two tasks in the dataset share the same non-empty `name` but have different `idx` values, `ReplayStore` indexes traces by `name` alone, so the second task's trace overwrites the first's in `by_seat`. Both tasks then replay the second task's trace — the first task's saved trace is silently lost. The lookup key should include `idx` (or another unique identifier) so tasks with the same `name` don't collide.
Summary
Seat replay: pin any env agent seat to a finished run's traces, so the other seats iterate against fixed work. Stacked on #2109 (uses its
agentic-judgeenv for the guard and the motivating workflow); retarget tomainonce that merges.AgentConfig.replay: Path | None— a run dir (or itstraces.jsonl). Each task returns that run's saved trace for this seat instead of sampling:_ReplayEpisodeAgentrevalidates the record (WireTrace) and re-stamps it with the seat's standing (name, trainable), so downstream env logic (episode.traces,finalize) sees it exactly like a live rollout. A single-seat source run matches any requested seat name (a plain single-agent baseline replays into a multi-agent env'ssolver); tasks are matched by task name (fallbackidx), with a clear error when the selection doesn't overlap the saved run.provision()on a replayed seat raises, andagentic-judgerefusesshared_runtime+ a replayed solver at construction with the fix in the message (--env.shared-runtime false).Env.runstays arbitrary user-space — chained/parallel/interleaved seats all work off the trace.uv run eval @ judges/scaleswe.toml --env.solver.replay <run dir>(same task selection as the source run), instead of a bespoke re-judge script.Verification
agentic-judge,--env.solver.replay <prior run> --env.shared-runtime false): the replayed solver trace keeps the source run's trace id verbatim while a live judge grades it in its own box; verdict lands asjudge/solved+ thejudgereward.judges/scaleswe.tomlwith a live glm-5.2 judge on prime sandboxes.ruff check, repoty check(diagnostic count unchanged vs main), full non-e2etests/v1green.Note
Add seat replay to pin any env agent to traces from a finished run
replaypath field toAgentConfigthat, when set, sources traces from a prior run'straces.jsonlinstead of sampling a model.ReplayStorein agent.py to index saved traces by seat and task key, with early errors for ambiguous or missing lookups._ReplayEpisodeAgent, which returns the stored trace and fires callbacks without performing inference; callingprovision()on it raisesRuntimeError.Env.agentsin env.py selects_ReplayEpisodeAgentwhenAgentConfig.replayis set, cachingReplayStoreinstances per path.AgenticJudgeEnvnow raisesValueErrorat construction whenshared_runtime=trueand the solver is configured with replay, since no box exists to share.📊 Macroscope summarized 9f38cd1. 3 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.