Repository navigation
feat(bundle): name bundled agents by alias, as claude-code for the shipped Claude Code - #304
Merged
Merged
Conversation
…ipped Claude Code A bundle task writing "a2a_agent_id": "claude-code" was refused unless the store held an agent of that id: the shipped Claude Code is @local/agentenv-framework/agents/claude-code. A bundle can now give its agents aliases in an aliases.toml at its root, and agent-env's agents bundle names Claude Code claude-code (and pi, pi). - A reference to an alias names the agent its installed bundle gives it, unless the run's bundle has an entity of that name or the store an agent of that id, which wins. The planner pulls the agent in and writes the task naming it by its id; an alias takes no pin. A configured default that's an alias is resolved the same way. - A step deploying, installing or judging with an agent outside a bundle run looks it up with A2AAgent.resolve: the store's agent of that id, else the alias's agent. - agent-env's own bundles' aliases are theirs; an alias two other bundles give is refused, naming both. The run and the dry run say which agent each alias names, `agent-env run` lists each bundle's aliases, and `agent-env plugin list` reports a refused claim (alias-refused). - The installed-bundle discovery moves to agent_env/plugins/_bundles.py, which imports nothing from agent_env.bundle, so a task step can read the aliases without the import cycle the bundle package's run would make; os_reason moves to agent_env/utils/paths.py with it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s's rules A pinned reference to a stored agent of an alias's id, or one whose alias two bundles clash on, now names that agent instead of being refused, at plan time and at run time. An aliases.toml that's a folder or a broken symlink is refused rather than ignored, an alias can't end in a newline, and a bundle run by its qualified name still says which aliases it's refused. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
End to end at 2a37e04: one m5.2xlarge (linux/amd64) admin VM, a clean venv with this branch's wheel,
No Modal sandboxes were left behind; the one container left was the |
…reading it A named pipe there would block every command that reads the installed aliases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…store has its own A bundle run and a step outside one both name the shipped Claude Code by its alias, and both name the store's agent once one is put under that id; the stored tasks hold the id each run resolved. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…esolves an alias `agent-env a2a-agent list` lists each agent the installed bundles ship, with the aliases that name it (marking one the store's agent of that id shadows), then the store's agents newest first, 50 unless --limit says otherwise; --json for scripts. `a2a-agent get --id <alias>` prints the agent a step naming it deploys. A name close to an alias that names no agent says which alias it may mean, at plan time and at run time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…does One get replaces get and resolve: the store's agent of the id, else the agent an installed alias names, so the validator steps and `a2a-agent deploy`/`validate` take an alias as the deploy, install and judge steps do. The planner reads the store by exact id itself (STORE_GETTERS), as it weighs aliases against the store on its own. A pinned alias is now NotFoundError like any other miss, and an id that can't be an alias skips the alias table. 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. A bundle task with
"a2a_agent_id": "claude-code"is refused today (there is no agent 'claude-code' in the store), since the shipped Claude Code's id is@local/agentenv-framework/agents/claude-code. The website's examples writeclaude-code. Came up while fixing #291.Change
aliases.toml,[agents] <folder> = ["alias", ...]. agent-env'sagentsbundle givesclaude-codeandpi. It sits at the root, not inagent.toml, which is in the image's build context.claude-codewins, pinned or not. An alias takes no pin.A2AAgent.getresolves the name in the same order, so every step and command that looks an agent up takes an alias: deploy, install, the judge, the validator steps,--a2a-agent-id, the configured default, anda2a-agent get/deploy/validate. The built-in default stays the full id.agent-env runlists each bundle's aliases, andplugin show/plugin list --jsonreport a refused claim asalias-refused.agent-env a2a-agent listlists the agents a task can name: each one the installed bundles ship, with its aliases (marking one the store shadows), then the store's, newest first, 50 unless--limitsays otherwise;--jsonfor scripts.a2a-agent get --id claude-codeprints the agent a step naming it deploys, and a name close to an alias (claude_code) says which alias it may mean.agent_env/plugins/_bundles.py(re-exported frombundle/installed.py), so a step can read aliases without thebundle→run→deploy_agentimport cycle.Verified. Unit tier passes (9,086). A slow integration test builds the shipped Claude Code with real Docker against a fake model endpoint: a bundle task and a step outside one both deploy it by its alias, then both deploy the store's agent once one is put as
claude-code. End to end on an admin VM, from a clean install of this branch's wheel, with a real model: see the comment below.For consumers.
A2AAgent.get(x)can now return an agent whose id isn'tx(whenxis an alias), and a pinned alias raisesNotFoundError. In the hub, only the validate route reuses the requested id after a get (it pairs it with the returned version); it should useagent.id, in the pin bump that picks this up.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new blocking issue remains.Summary
Bundles can give agents short aliases, including
claude-codeandpifor the shipped agents.a2a-agent listshows installed and stored agents.No new actionable issues were found. The five earlier, unnumbered findings are addressed in the current code. This review checked code and tests without running them.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Task names an agent] --> B{Defined in this bundle?} B -->|Yes| C[Use this bundle's agent] B -->|No| D{Installed full id?} D -->|Yes| E[Pull installed agent into run] D -->|No| F{Stored agent with this id?} F -->|Yes| G[Use stored agent] F -->|No| H{Accepted installed alias?} H -->|Yes, without pin| E H -->|No, or pinned| I[Report why the name cannot be used] E --> J[Save explicit task reference by full id]Reviews (6) · Last reviewed commit: "refactor(a2a-agent): A2AAgent.get resolv..." · Reviewed by Greptile