Repository navigation
fix(task-steps): a run-wide agent pick of another agent no longer takes the step's pinned version - #842
fix(task-steps): a run-wide agent pick of another agent no longer takes the step's pinned version#842cikowski wants to merge 2 commits into
Conversation
…es the step's pinned version Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ng state which version a picked agent runs at
agutmanstein-scale
left a comment
There was a problem hiding this comment.
Approved at 61dcf8d. No blockers. Step overrides and a run-wide a2a_agent_version still win. Otherwise a run-wide pick of another agent gets its latest version and never the step's pin, and picking the step's own agent keeps the pin. install_agent behaves the same way. This is the UGML-1860 fix that synthetic-pipelines #2367 needs before re-registering.
yzabelle-go
left a comment
There was a problem hiding this comment.
Right fix: picking mine used to deploy mine at theirs's pin. The 144 touched tests pass locally, and merge-tree with main is clean. Two small comments: the CLI can't set the version the new help mentions, so a CLI pick always floats to latest, and the _resolve_agent_ref docstring now contradicts the own-agent case. Approving.
src/agent_env/task_step/task_steps/deploy_agent.py:335: This docstring still says an overridden id never takes the stored pin, but with this PR a pick of the step's own agent (or the default agent for an unnamed step) keeps it, as test_a_pick_of_the_steps_own_agent_keeps_its_pin checks. Worth updating it to the rule picks_another_agent now implements.
| @click.option("--apply-trajectory-filter/--no-trajectory-filter", "apply_trajectory_filter", default=None, help="Force trajectory filtering on/off for rubrics_verifier (overrides the step's trajectory_filter setting)") | ||
| @click.option("--a2a-agent-id", default=None, type=str, | ||
| help="Override A2A agent id for deploy_agent steps; a user sim's agent keeps its own") | ||
| help="Override A2A agent id for deploy_agent and install_agent steps; an agent other than the step's own runs at the run's a2a_agent_version, else its latest, never the step's pinned version; a user sim's agent keeps its own") |
There was a problem hiding this comment.
This help names "the run's a2a_agent_version", but task run has no flag that sets it: line 422 only writes user_overrides["a2a_agent_id"]. So after this PR, task run --a2a-agent-id mine on a task pinned to theirs v4 always gets mine at latest, resolved separately in each step, and the only way to pin it is a hand-written --context-json. Could you add --a2a-agent-version next to --a2a-agent-id (written into user_overrides), or say "latest; pin via --context-json user_overrides.a2a_agent_version" in the help?
What and why
A step's
a2a_agent_versionis the pinned version of the agent that step names. When a run picks a different agent for the whole run (user_overrides.a2a_agent_id:task run --a2a-agent-id, a hub run's agent pick) and gives no version,deploy_agentandinstall_agentasked the store for the picked agent at the step's pinned version. Onmain, a step pinned totheirsv4 run with a pick ofmineasks forminev4: a version that does not exist, or an unrelated build of the other agent.Now a run-wide pick that names another agent is deployed or installed at the run-wide
a2a_agent_version, or at its latest version when none is given. A pick that names the step's own agent (or the configured default agent, for a step that names none) keeps the step's pin.Unchanged: a step's own
step_paramsoverride, a run-wide version with no run-wide id (applies todeploy_agentsteps only, as before), anddeploy_user_sim_agent, which never takes the run-wide pick.Rollout
install_agentstep given a pick of another agent together with a run-widea2a_agent_versionnow installs that version, where it used to install the step's pinned version, or latest for an unpinned step. Everything else resolves as before: a run with no pick, anddeploy_agentsteps that pin no version. Callers that want a fixed version of the picked agent passa2a_agent_versionwith it; without one, each step resolves latest when it runs.deploy_agent.pyandinstall_agent.py, and drafts refactor(env): reach pgweb and db-mcp only through the gateway's /svc routes #823 and feat(env): give each computer in a multi env a control token of its own #825 touchcli/task/run.py, all on other lines; no ordering between them and this one.How it was tested
Validation: head
61dcf8d3a7c597f5f79c061e5230ca370000fc36. Each case runs the step'sexecute()and reads the(id, version)it asks the agent store for.test_a_pick_of_another_agent_does_not_take_the_steps_pinned_versionx3: fails onmain(('mine', 4)), passes on headtest_a_pick_of_another_agent_with_a_version_deploys_that_versionx3; the install case fails onmaintest_a_pick_of_the_steps_own_agent_keeps_its_pinx3,test_a_step_with_no_pick_keeps_its_agent_and_pinx3test_a_step_naming_no_agent_keeps_its_pin_only_for_the_default_agentx2: fails onmaintest_a_pick_runs_where_the_default_agent_cannot_be_readx2: fails onmainon the version, and without theConfigErrorcatch.venv/bin/python -m pytest -n0 tst/unit/task_step/run_wide_agent_pick_test.py tst/unit/bundle/agent_override_test.py tst/unit/task_step/test_step_overrides_agent_and_model.py tst/unit/task_step/test_deploy_user_sim_agent.py tst/unit/task_step/install_agent_test.py tst/unit/cli/task_run_agent_pick_test.py: 144 passed.ruff check: clean.main's two resolvers, 8 of the 18 cases inrun_wide_agent_pick_test.pyfail (the rows marked above: 3 + 1 + 2 + 2).pytest tst/unit/task_step tst/unit/cli tst/unit/bundle -n 4: 5,793 passed, 14 skipped, 6 failed. The six (computer_exec_test.py,test_mcp_cli_builder.py) fail the same way withmain'ssrcon my machine, do not import this code, and pass in CI. A stale assertion of the old behaviour intst/unit/bundle/agent_override_test.pyis updated here.tst/unit. The repo has no type-check orruff formatgate.--helpline).Quality bar
Head
61dcf8d3a7c597f5f79c061e5230ca370000fc36.ruff check,pyteston the touched suites)61dcf8dmain, unrelated); ruff cleanorigin/main's resolvers1db49ddmain61dcf8dmainas stated61dcf8d61dcf8d61dcf8d61dcf8dpr_gate.py check61dcf8dRelaxations: none.
Not in this PR
Known limitations:
maindid not read it. Waived: catching every backend error here would hide an infrastructure failure that the same step hits on any run without a pick.deploy_agenttakes that version andinstall_agentkeeps its pin (pre-existing onmain;install_agenthas never read a run-wide version for its own agent).🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Run-wide picks of a different agent now use the picked version, or latest when none is given, instead of inheriting the step’s pinned version.
cikowski documents these accepted limits: aliases count as different agents; a secret backend error while reading the default agent can fail the step; and same-agent picks retain the existing difference between deploy and install version choices. No new actionable issues were found in the changes since the previous review.
Reviews (4) · Last reviewed commit: "address review round 2: the pick's help ..." · Reviewed by Greptile