Skip to content

fix(bundle): bundle init pins a pulled image to the digest its store records - #764

Open
earakely-scale wants to merge 2 commits into
mainfrom
edgararakelyan/bundle-init-pins-pulled-images
Open

earakely-scale wants to merge 2 commits into
mainfrom
edgararakelyan/bundle-init-pins-pulled-images

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Collaborator

What

bundle init writes some images as registry refs: one whose store holds no build context, or one whose context the folder can't hold. It wrote artifact.image_name alone. An image stored by digest, as bundle register stores { ref = "<repo>@sha256:…" }, therefore went into the folder as its bare repository, and a run would pull whatever that repository's latest is.

Both places now write the image by its digest alone, <repo>@sha256:… (registry_api.by_digest of artifact.pinned_name), whether the digest is recorded beside the name or inside it. A tag is left out because pin_digest refuses name:tag@digest once the tag moves, which would stop the bundle's first run although the registry still serves the image by digest. An image with no digest is written as before. A computer base named from a registry goes through the same path, so it's written by digest too.

Why

I found it exporting the laptop task's computer version from the dev hub (HB5.1.1, FD-6206). Its Shelfway frontend's context couldn't be written: its Dockerfile COPY . . includes the folder's own env.toml. The fallback ref came out as …/shelfway-frontend with no digest.

Proof

  • New tests in importer_entities_test.py, one per branch:
    • a registry image stored by digest with no context;
    • an image whose context can't be written.
    • Each writes ref = "<repo>@sha256:…", for a tagged name with the digest beside it and inside it, and both fail
      without the fix.
  • New tests in registry_api_test.py: by_digest drops a tag beside a digest, and a ref by digest alone still
    pins once its tag has moved, where name:tag@digest is refused.
  • computer_to_toml_edges_test.py: a registry-named base now reads back as desk@sha256:…, the digest the store
    holds.
  • Suites on a Linux host: tst/unit/bundle, tst/unit/store, tst/unit/artifact and the protocol tests: 4,481 pass. One fails, version_lookup_benchmark_test.py, which needs a git checkout and the copy had none.
  • ruff check: clean.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the moved-tag failure is fixed.

Summary

bundle init now keeps stored image digests in registry references and removes adjacent tags so later tag changes do not break the exported bundle.

  • Bundle imports keep registry images pinned to their stored digest.

Reviews (2) · Last reviewed commit: "fix(bundle): a pulled image is written b..." · Reviewed by Greptile

…records

An image bundle init writes as a registry ref (one with no context the folder can hold) was written as its
image_name alone, so an image stored by digest, as bundle register stores a `{ ref = "<repo>@sha256:..." }`
image, went into the folder as its bare repository: a run would pull whatever that repository's latest is. It's
written as its pinned_name now, the name a sandbox pulls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 18, 2026 05:34
Comment thread src/agent_env/bundle/importer.py Resolved
A ref giving a tag beside its digest is refused once the tag moves, so the
bundle's first run would stop before deploying an image its registry still
serves by digest. A computer base named from a registry is written the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant