Skip to content

fix(bundle): bundle init names an installed agent registered under its alias by the alias - #789

Merged
earakely-scale merged 3 commits into
mainfrom
edgararakelyan/bundle-init-installed-alias
Nov 18, 2026
Merged

earakely-scale merged 3 commits into
mainfrom
edgararakelyan/bundle-init-installed-alias

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

bundle init names an agent, env or artifact by its installed alias, floating, when the store holds it under that alias because bundle register wrote it there from the installed bundle. It no longer writes it into the folder.

Why

bundle register writes an installed bundle's entity a task names by alias (say claude-code) into a shared store under the alias, and the stored task names the alias. bundle init then treated it as one of the store's own and wrote agents/claude-code/ into the folder. In a run, a bundle's own entity beats the installed one, so the exported bundle carried a frozen copy of agent-env's Claude Code instead of using the runner's. Found exporting a PSI benchmark task from the dev hub (psi-benchmark-tasks #19).

How

The importer floats an id only when both hold:

  • an installed bundle gives that id as an alias of this kind, and
  • the store's registration ledger (bundle_registrations) has a done row for this id and version, written from that installed bundle (installed:<its root>).

An entity stored under the alias any other way, by a hand put or a later version, is still written into the folder, as before. This applies to a task step's reference. An entity another exported entity names is still written into the folder, as before. A stored pin is dropped, as for an installed bundle's id.

No folder takes an installed alias that a step of the export names. Otherwise, in an export that floats claude-code and writes another version of claude-code into the folder, the folder would capture the floating step in a run, since a bundle's own entity is read before an alias. Such a version is written as claude-code-2, whatever order the export runs in. The names are collected from the tasks before any folder is named, reading no store. The ledger is read only for a step that names an alias, whose entity the export reads from that store anyway. An export whose steps name no alias never reads it, so a local-only export doesn't depend on a remote store. Other ids keep their names, such as a stored mail env no step names.

Tests

  • importer_test.py: Claude Code registered by its alias imports floating, unpinned, with no agents/ folder. An agent put under claude-code by hand is still written into the folder, as claude-code-2, alone or over a registered version. An export whose steps name no alias imports with the configured store unreachable. An export with both a hand-written v2 and the registered v1 writes v2 to agents/claude-code-2 and floats v1 as claude-code.
  • tst/unit/bundle/: 1283 passed.
  • End to end: the PSI laptop task (scaleapi/psi-benchmark-tasks docs: drop CLAUDE.md now that Claude Code reads AGENTS.md #19), whose deploy step names claude-code:
    • Register: registered on AgentEnvHub's dev hub with 0.9.1565. The store got claude-code v1 and a ledger row {store: agent, id: claude-code, bundle: installed:agentenv-framework/agents, version: 1}.
    • Export: before this change, bundle init wrote agents/claude-code/ (Claude Code's 44 files). With it, cherry-picked onto 0.9.1565, the bundle names claude-code, floating, with no agents/ folder, and the report says why ("the store holds it under its alias as registered from the installed bundle agentenv-framework/agents").
    • Run: a fresh copy of that bundle on a Linux VM, with agent-env 0.9.1565 from PyPI and fresh local stores. The plan read claude-code → @local/agentenv-framework/agents/claude-code (the alias agentenv-framework's agents bundle gives it). The assistant's container ran the published ghcr.io/scaleapi/agentenv-claude-code:src-3238047… image. A full model run completed in 30 minutes with every verifier run (the task passed). Re-exported with every commit here, the bundle is identical but for the import's timestamp.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous remote-access issue is fixed and no new blocking issues were found.

Summary

bundle init keeps registered installed entities as unpinned aliases instead of copying them into the exported folder.

  • Bundle imports leave registered installed aliases floating.

The previous remote-access finding is fixed. No new actionable issues were found.

Reviews (3) · Last reviewed commit: "fix(bundle): reserve the aliases an expo..." · Reviewed by Greptile

…s alias by the alias

bundle register writes an installed bundle's agent, env or artifact into a
shared store under its alias (claude-code), and a task there names it so.
bundle init then read it as one of the store's own and wrote it into the
folder, where it shadows the installed one: the folder carried a frozen copy
of agent-env's Claude Code. Now, when the registration ledger in the store
says that version was written from the installed bundle that gives the alias,
the import names the alias, floating, as it does an installed bundle's id. An
entity stored under the alias any other way is still written into the folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale marked this pull request as ready for review November 18, 2026 23:06
@earakely-scale
earakely-scale requested a review from a team as a code owner November 18, 2026 23:06
Comment thread src/agent_env/bundle/importer.py Resolved
An export that floats an installed alias (claude-code) and writes a different
version of that id into the folder named the folder after the alias, which a
run reads before the alias, so the floating step took the folder's entity.
A folder now never takes an alias the store holds a registered version of,
whatever order the export runs in; other ids keep their names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/agent_env/bundle/importer.py Resolved
…ng a store

The folder names an export keeps off installed aliases are now those its
steps name, collected from the tasks before any folder is named, so an export
that names none never reads the configured store's registration ledger: a
local-only export no longer depends on a remote store being reachable. The
ledger is read only for a step that names an alias, whose entity the export
reads from that store anyway. An entity another entity names is written into
the folder as before; only a step's reference floats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 99c6ae2 into main Nov 18, 2026
61 of 64 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/bundle-init-installed-alias branch November 18, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant