Skip to content

fix(bundle): register fails when a computer env it writes has no build a deploy can boot - #758

Merged
earakely-scale merged 3 commits into
mainfrom
edgararakelyan/register-fails-without-ready-build
Nov 18, 2026
Merged

earakely-scale merged 3 commits into
mainfrom
edgararakelyan/register-fails-without-ready-build

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Collaborator

What

agent-env bundle register now fails when a computer env it writes or reuses has no build a deploy can boot.

Before, a registration whose compose failed still wrote the env and the tasks that deploy it, and exited 0. One case: a builder's disk filled while composing a desktop, leaving its container failed. Every deploy of those tasks then failed.

Now, as a registration materializes (materialize(..., bootable=True)), each computer env is checked after its compose. That covers one written new, and one reused that composes what it has left. The registration stops when the compose recorded builds but none is ready or unverified, that is, each failed, was skipped, or was recorded by an agent-env that composes differently. It stops once every entity is written, before any task or eval, raising BundleError:

envs/desktop: broken-desktop v1 has no build a deploy can boot (container/amd64 failed (the build failed: ...
exit code: 1); container/arm64 skipped (emulation is off, and LocalSandboxProvider doesn't run linux/arm64 natively)),
so no task was written: register again to compose what it left, emulating a skipped arch or on a --sandbox that runs it
natively, or compose it with agent-env env build --id broken-desktop --version 1 and then register again
  • What stays written. The env stays, in the ledger, so registering again reuses it, composes its failed pairs (pending), and writes the tasks once one builds.
  • Why unverified counts. An unverified container is probed by the first deploy where its arch runs natively (compose_unstarted). An unverified disk or VM bundle deploys as is.
  • A skipped arch is named, since registering again with the same --no-emulate would skip it again.
  • A computer env with no compose record isn't checked. None of today's callers produce one, but a registration that composes only the forms its deploys boot can leave one with nothing composed (feat(bundle): register's --sandbox composes only the forms its tasks' deploys there boot #759, stacked on this one).

Unchanged: agent-env run, prepare_bundle, a2a-agent validate and dry runs don't pass bootable. A run's deploy composes what it boots first, as before.

Limits, said here rather than handled:

  • The rule doesn't ask which provider deploys. A registration from a Mac can leave container/arm64 ready with the emulated amd64 build failed. That passes, though a hub deploying on amd64-only providers can't boot it.
  • A computer_app env that names a computer and driver composes its own one-app computer. If that fails, it stops the tasks even when they use the app only inside another computer.

Why

Found while registering PSI's whole-computer desktops on an agent-environments-admin VM. A desktop's container build failed when the disk filled, and bundle register exited 0. The failure showed up only at the first deploy.

Proof

  • Unit tests:
    • register_test.py::test_a_computer_env_whose_compose_leaves_nothing_a_deploy_boots_fails_the_registration_before_its_tasks, through the CLI: exit 1, the message, the env written, no task.
    • computer_env_folder_test.py::test_a_computer_env_no_deploy_could_boot_stops_its_tasks_until_composing_it_again_builds_one: a stale ready doesn't count. Materializing again reuses the env, composes its four pairs, and writes the task.
    • Both fail without the change.
    • tst/unit/bundle, tst/unit/env and tst/unit/cli: 4,328 passed, 11 skipped. One fails, test_disk_recipe.py::test_a_windows_install_boots_its_iso_first_..., which fails on main on this Mac too: it runs the recipe's shell with macOS's tools.
    • ruff check src tst passes.
  • An independent review of the change found no correctness problem. Its two findings, now fixed, were in the message: it offered env build as an alternative to registering again, though env build writes no task, and it didn't say how a skipped arch builds.
  • Live, on an agent-environments-admin VM (local stores, --no-emulate), with this branch and the stacked one:
    • A computer env of the shipped ubuntu-24.04 and reference, copied into a bundle: exit 0, container/amd64: ready (56 s), task written.
    • The same with an app whose install step raises: container/amd64: failed at build, exit 1, the message above, and the task not written.
    • Registering it again: every write unchanged, the failed pair composed again, failed again, exit 1.
    • With the install step fixed but the launch naming a program the base lacks, the build passes and the probe fails: failed at probe ("its launch failed: FileNotFoundError: ... 'xterm'"), exit 1, no task. A build that fails its probe counts too.
    • With the app fixed: container/amd64: ready (27 s), exit 0, and the task written (broken-deploys v1).

Found on the way, filed as FD-6225: registering a bundle a second time into a shared store, as the hub does, writes new versions of whatever names an installed alias, though nothing changed.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no outstanding findings.

Summary

Registration now stops before writing tasks or evals when a computer env has recorded builds but none can boot.

  • Bundle registration stops before tasks when a computer env has no bootable build.

Reviews (2) · Last reviewed commit: "refactor(bundle): name how much of a bui..." · Reviewed by Greptile

earakely-scale and others added 2 commits November 17, 2026 17:12
…d a deploy can boot

A registration whose compose of a computer env failed, a builder's disk full say, wrote the env and the tasks that
deploy it and exited 0, though no deploy could boot it. With bootable, as a registration materializes, a computer env
written or reused whose compose recorded builds but none ready or unverified stops it once every entity is written,
before any task or eval, naming each build's status and reason. Registering again composes what it has left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a skipped arch builds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/agent_env/bundle/materialize.py Resolved
…oblem quotes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 2fcdd3d into main Nov 18, 2026
61 of 63 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/register-fails-without-ready-build branch November 18, 2026 04:05
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