Repository navigation
feat(run): --agent runs a bundle's solver as another agent - #314
Merged
Merged
Conversation
`agent-env run <bundle> --agent pi` deploys the named agent at each step that deploys or installs an agent a prompt_agent step prompts, and not its user simulator, for this run only; the tasks stay as written. The name resolves as a task's reference would (this bundle's agent, an installed bundle's, an alias, or the store's), and the agent is pulled in, written and preflighted with the run. The steps get it through per-step step_params overrides, which install_agent now honours as deploy_agent does. A dry run says what the solver deploys. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
earakely-scale
marked this pull request as ready for review
October 23, 2026 00:53
The task write's step preflight checked the agent each install_agent step names, so a --agent agent that can't be installed passed the dry run and failed once its sandbox was up, and a task naming one refused a good --agent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
End to end on one m5.2xlarge (linux/amd64) admin VM.
pi works in No containers or Modal sandboxes were left behind, and the results contain no secret text. The VM, security group and key pair are deleted. |
A store agent ran at its latest version when each task deployed it, so one put mid-run could deploy a version preflight never checked, and tasks of one run could deploy different versions. The plan's read version now goes to the run's step params and to both preflights, as bundles pin their other store references. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The unit tests stop at the step params a run sets; this one deploys both agents with docker and reads which one replied, then runs the task as written to show it stays at its version. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… task does --agent folded the name, so --agent helper ran the bundle's Helper where a task reference or --task refuses the near miss. It now matches exactly and refuses a case-only miss with the same message. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…step override itself deploy_agent already honors step_params, so its resolution moves back into its own method. install_agent takes a step_params agent first and otherwise keeps its rule, so task run --a2a-agent-id installs as it did. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reading the stat file of a process that exits after the open raises ProcessLookupError (ESRCH), not FileNotFoundError, so the Claude Code bridge cancel test failed on CI on the very exit it waits for. The local sandbox test's helper had the same race. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Why.
agent-env runhas--modelbut no way to pick the agent. Running a bundle's task with Pi or OpenHands instead of Claude Code means editing the task, and onlytask run --a2a-agent-idcan override it, for stored tasks. Comparing harnesses on the same task should be one flag.Change
agent-env run <bundle> --agent <name>(and--dry-run) runs each task's solver as that agent. It resolves the name the same way as a task reference to an agent: an alias such aspioropenhands, an agent of this bundle by its folder name, an installed bundle's agent, or the store's by id.a2a-agent getgives (did you mean the alias 'pi'?).deploy_agentandinstall_agentsteps for an agent aprompt_agentstep prompts, minus the user sims those steps name (user_agent_name);plan.solver_stepspicks them. User sims, judges and other agents keep the agents their tasks name.user_overrides.step_params[<step>] = {a2a_agent_id, a2a_agent_version}, whichdeploy_agentalready honors per step.install_agentnow reads it too. Otherwise it keeps its rule, sotask run --a2a-agent-idinstalls as before.deploy_agentis unchanged.--agentagent at the steps it swaps, so an agent that can't be installed is refused before any sandbox starts.--agent pi: the solver deploys @local/agentenv-framework/agents/pi, in 1 of 1 task, plus the alias line.Tests
agent_override_test.pycovers:run_bundle_built_agents_test.py(slow tier, about 25 s): a task naming one built echo agent runs with--agentset to another. It checks which agent replied from the instance, then runs the task as written to confirm it stays v1.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
Adds
agent-env run --agentto replace solver agents for one run without changing saved tasks.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A["run --agent NAME"] --> B["Resolve agent and solver steps"] B --> C["Check replacement agent"] C --> D["Write bundle entities"] D --> E["Set per-step agent ID and version"] E --> F["Run selected tasks"] F --> G["Saved task definitions stay unchanged"]Reviews (6) · Last reviewed commit: "test: treat a process that exits mid-rea..." · Reviewed by Greptile