Repository navigation
fix: a multi-turn step's trajectory readers offer every turn, not only the last - #979
Open
sarah-chitty-1 wants to merge 3 commits into
Open
sarah-chitty-1 wants to merge 3 commits into
sarah-chitty-1 wants to merge 3 commits into
Conversation
…ly the last An always_on step's prompt response already records each wake's trajectory, in wake order, under target_agent_per_turn_trajectory_s3_uris / _object_urls. agent_trajectory_s3_uri is the last wake alone (on a 7-wake run, 15 of its 353 tool calls). Every verifier that scores reads the per-turn list or no trajectory, so no score came from one wake. Two readers here did read only the last: - `agent-env task run` printed only agent_trajectory_object_url. It now lists every turn's url too, when there is more than one, and keeps the existing line. - The explorer's download bar offered only the last turn of each prompt response. It now gives one entry per turn, labelled by turn, reading turns that share an atif/1 document once. PromptResponse.trajectory_object_urls() and the UI's runTrajectoryUrls() name the rule once: each turn's url in order, without gaps or repeats, then the last url if the list lacks it. It is the same rule agentenvhub-sdk's trajectory_validation already applies. A test pins that an always_on run's stored prompt response carries every wake under both stored keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…or a multi-turn step Two kinds of step store one trajectory per turn in target_agent_per_turn_trajectory_object_urls: an always_on step, one per wake, and a multi-turn prompt_agent step, one per turn (a user-sim conversation). The previous commit made the download bar offer every turn, but as one button per turn, so a 20-turn conversation put 20 buttons in the bar. The bar now has one entry per prompt response: - A response with one trajectory keeps its label, tooltip and button exactly as before. - A response whose turns stored several distinct trajectories gets a button that downloads its last turn, labelled "Trajectory (turn n of n)" (or "<step> (turn n of n)"), and a chevron that opens a turn picker listing every turn as "turn k of n". In the collapsed dropdown it is one row with the turns in a submenu. - A Claude Code atif/1 run, whose turns share one document, still gets one plain button. Both use the explorer's existing Radix Themes DropdownMenu. The collapse threshold now counts responses. Tests: the bar smoke covers a single trajectory (unchanged), an always_on run of several wakes, a 20-turn prompt_agent conversation beside a single-turn step, and atif shared turns; the trajectory-url smoke and the `task run` CLI tests add a multi-turn prompt_agent case. No grader or score reads any of this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…un list's last entry The bar's main button took the last entry of runTrajectoryUrls. An atif/1 run whose middle turn's copy failed stores per-turn [A, B, A]; the de-duplicated list is [A, B], so the button downloaded B while agent_trajectory_object_url is A. It now downloads the response's own url (trajectoryUrl), labelled by the last turn that stored it, falling back to the list's last entry when the response has none. The picker still lists every distinct trajectory. A url the per-turn list lacks is labelled "last available", not "last turn". agent_trajectory_object_url is the last available trajectory, not always the last turn's: both writers (always_on, prompt_agent) take the last turn that stored one. Say so in PromptResponse, trajectory_object_urls() and the explorer's helpers. 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 was broken
Two kinds of step run several turns and store one trajectory per turn in
target_agent_per_turn_trajectory_object_urls:always_onstep, one per wake;prompt_agentstep, one per turn, e.g. a user-sim conversation.agent_trajectory_object_urlholds only the last turn's. The explorer's download bar and theagent-env task runoutput read only that field, so the earlier turns could not be downloaded from either.What changes
Explorer download bar. One entry per prompt response.
The picker uses the explorer's existing Radix Themes
DropdownMenu. No new UI library.CLI.
agent-env task runkeeps itsagent_trajectory_object_urlline. When a response has more than one trajectory, it also lists every turn's URL in turn order.PromptResponse.trajectory_object_urls()and the UI'srunTrajectoryUrls()hold the rule in one place each: every turn's URL in order, without gaps or repeats, then the last URL if the list lacks it.What is not affected
No grader or score changes. Every verifier that scores already reads the per-turn list or no trajectory.
The explorer's trajectory viewer already showed every turn of both kinds of step, so it is unchanged.
Tests
bar-downloads.smoke.ts: a single trajectory (unchanged), an always_on run of several wakes, a 20-turn prompt_agent conversation beside a single-turn step, and atif shared turns. The multi-turn cases fail both on the previous commit (one button per turn) and onmain(last turn only).trajectory-url.smoke.ts:runTrajectoryUrlsfor always_on wakes, a multi-turn prompt_agent run, atif shared turns, and a single trajectory.trajectory_object_urls()cases; thetask runoutput for always_on and multi-turn prompt_agent steps (these fail with the CLI change reverted); an always_on run's stored prompt response carries every wake under both stored keys.tsc --noEmit, eslint on the changed files,tst/unit/cliplus the trajectory unit tests (all pass), andruff check.Follow-up
The hub has the same gap:
get_run_statusandget_task_runreturn only the last turn's trajectory URL.🤖 Generated with Claude Code
Confidence Score: 5/5

The PR appears safe to merge; the previous main-download issue is fixed.Summary
The PR makes every distinct turn trajectory available through the explorer download bar and CLI.
Reviews (3) · Last reviewed commit: "fix(explorer): a response's download is ..." · Reviewed by Greptile