Revert "feat(v1)!: move run info from trace to episode" - #2264
Conversation
This reverts commit f14b41c. Run identity returns to Trace.run / Trace.record_run. The episode-level home turned out to push consumers that keep per-trace records into episode reconstruction for no gain. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| records.append(record) | ||
| trace.record_run(EvalRunInfo(id=config.uuid)) | ||
| await append_trace(out, trace, write_lock, env=config.env_id) | ||
| records.append(Episode.of(trace)) |
There was a problem hiding this comment.
🟡 Medium eval/runner.py:263
In run_group_unit, each trace is persisted with append_trace(..., env=config.env_id), but the in-memory episode returned to callers is built via Episode.of(trace) without passing env. As a result, every group-scored legacy result returned by run_eval_server has an empty episode.env.id, even though the same episode on disk carries the configured environment ID. The previous code constructed Episode.of(trace, env=config.env_id), so this change silently drops the env metadata from in-memory results. Pass env=config.env_id to Episode.of to preserve the in-memory episode's environment identity.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @verifiers/v1/cli/eval/runner.py around line 263:
In `run_group_unit`, each trace is persisted with `append_trace(..., env=config.env_id)`, but the in-memory episode returned to callers is built via `Episode.of(trace)` without passing `env`. As a result, every group-scored legacy result returned by `run_eval_server` has an empty `episode.env.id`, even though the same episode on disk carries the configured environment ID. The previous code constructed `Episode.of(trace, env=config.env_id)`, so this change silently drops the env metadata from in-memory results. Pass `env=config.env_id` to `Episode.of` to preserve the in-memory episode's environment identity.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eaab120. Configure here.
| records.append(record) | ||
| trace.record_run(EvalRunInfo(id=config.uuid)) | ||
| await append_trace(out, trace, write_lock, env=config.env_id) | ||
| records.append(Episode.of(trace)) |
There was a problem hiding this comment.
Returned episodes diverge from persisted records
Medium Severity
append_trace persists one episode shell, while Episode.of(trace) creates a different returned shell with a fresh id and empty env. Group-run callers therefore receive episode identities that differ from traces.jsonl and lack environment provenance.
Reviewed by Cursor Bugbot for commit eaab120. Configure here.


Summary
Trace.run/Trace.record_run, andEpisode.run/Episode.info/Episode.record_runare removed.Moving the run onto the episode forced consumers that keep per-trace records (prime-rl's orchestrator) to reconstruct episode shells around traces just to place them, and the episode-level home only pays off with the rest of the episode-first pipeline (#2252 / prime-rl#3206), which we're not taking. Reverting keeps the trace self-describing and makes the prime-rl pin bump trivial.
Verification
Both pass. Only in-tree users of the episode-level fields were
Episode.record_runitself and the three eval-runner call sites restored here.🤖 Generated with Claude Code
Note
Move run info from episode level to trace level in v1 eval runner
runandinfofields and therecord_runmethod fromEpisode; run metadata is no longer stored at the episode level.run: RunInfo | Nonefield andrecord_runmethod toTraceso each trace carries its own run metadata.eval.runnerto calltrace.record_run(...)on each trace within an episode instead of stamping the episode directly.append_traceandEpisode.of(trace)is called without anenvargument, leaving env id empty on returned Episode records.Episode.record_runis removed; callers must now stamp run info on individual traces.Macroscope summarized eaab120.
Note
Medium Risk
Changes persisted artifact shape and public v1 APIs (
Episode/Trace); callers that adopted episode-levelrunmust migrate back to per-trace stamping.Overview
Reverts the episode-first run stamping from #2244 so eval and downstream consumers (e.g. prime-rl) can keep per-trace records without wrapping traces in episodes just to attach run identity.
Traceagain hasrun: RunInfo | Noneandrecord_run, which sets run id/type and merges optional metadata intotrace.info.Episodedropsrun,info, andrecord_run—episodes are no longer the place for consumer-stamped run metadata.The v1 eval runner stamps
EvalRunInfoon every trace in an episode (on_complete,run_unit, and the legacyrun_grouppath). Group rollouts persist each trace withappend_trace(withenv=config.env_id) and returnEpisode.of(trace)shells for in-memory results; single-rollout paths still useappend_episodeafter per-trace stamping.Reviewed by Cursor Bugbot for commit eaab120. Bugbot is set up for automated code reviews on this repo. Configure here.