Skip to content

feat(bundle): bundle init writes computer envs into the folder - #757

Merged
earakely-scale merged 3 commits into
mainfrom
edgararakelyan/fd-6220-hb518-bundle-init-writes-computer
Nov 18, 2026
Merged

earakely-scale merged 3 commits into
mainfrom
edgararakelyan/fd-6220-hb518-bundle-init-writes-computer

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Collaborator

What

agent-env bundle init can now write computer envs into the bundle folder, so a computer task's bundle runs with no store.

Before, the computer, computer_app and computer_driver envs and the computer artifact had from_toml but no to_toml. bundle init therefore left the desktop out of the folder:

  • without --include-scope user, the import failed;
  • with it, the desktop stayed in the store, pinned, so the folder only ran against that store.

Now each type writes itself out as the folder its from_toml reads back:

  • computer_driver: its files, plus module, port (when not the default), install and known_failures.
  • computer_app: its files, plus environment_name, module, computer and driver (when it names them), build_settings and settings.
  • computer env: environment_name, computer, driver, and apps. An app with default settings is written as a table with its settings beside it. Also display, network, computer_settings and tools.
  • computer artifact: description, arch, os, session, forms and config. Each form's image is written as bundle init writes any image: its build context pruned into the folder, or its registry ref.

What a computer env composed, and its probe results, are not written. A run of the folder composes the desktop from these sources, as any computer bundle run does.

Entities from an installed bundle stay references. When a written entity names one, the folder names it by its id instead of copying it in, and the import lists it as floating. The shipped ubuntu-24.04 base and reference driver are the common case. This is what a task's own references to installed entities already did; nested references (out.ref) now match.

Why

PSI-bench tasks are published as bundle init --from-task output, so anyone can run them with agent-env run. A task's computer version couldn't be exported that way, because its desktop stayed in the store.

Proof

  • Unit tests, all in the default mode, so anything left in the store fails them:

    • tst/unit/bundle/computer_to_toml_test.py (3 tests): the base computer, driver, apps, computer env and the multi env holding it are exported. The folder is planned and written back with no store, and every field and file matches what was stored. A shipped base and driver stay as their installed ids.
    • computer_to_toml_edges_test.py (6 tests, chaos):
      • A folder a run wrote back exports byte for byte as the same folder.
      • int, float and bool settings keep their types. A linux/ubuntu install, binary files and unicode file names come back as they were.
      • A base named from a registry, with a disk built from a source, is written as both, and its folder holds no context.
      • An app deployed alone is written with its computer and driver.
      • A driver and base two computers share are written once.
      • A stored context that is gone fails the import, naming artifacts/base, and writes nothing.
  • tst/unit/bundle and tst/unit/env: 3,874 passed, 1 failed. The failure, test_disk_recipe.py::test_a_windows_install_boots_its_iso_first…, also fails on main on macOS.

  • ruff check: clean.

  • End to end on Linux (x86_64, real Docker, local stores):

    • Author run: a copy of the integration app bundle, task together. The desk has the notes and clock apps, and its driver is a copy of reference. Exit 0.
    • Export: agent-env bundle init --from-task <its id>, without --include-scope user. Exit 0. Written: envs/desk-driver, envs/notes, envs/clock, envs/desk and artifacts/check_desk, each with its files. Floating: the shipped ubuntu-24.04 and reference, as their installed ids. Nothing was pinned.
    • Outsider run: agent-env run <the folder> --task together against a fresh state dir. Exit 0.
      • Each compose found the same image key as the author run ("reusing the image of the same key, built earlier"), so the folder holds exactly the inputs the original was composed from.
      • The together check's results were identical in both runs, and equal to what tst/integration/computer/computer_app_test.py expects: {"notes": {"signature": "-- Ada", "token": "t0ken"}, "clock": {"zone": "Europe/Paris", "served": {...}}, "card": "desk", "app_ready": ["app clock", "app notes"], "launched": ["notes"], "folders": ["clock", "notes"], "hello": true, "paris": true}.
  • End to end on AgentEnvHub's dev stage (agentenvhub-sdk 0.40.36: Mongo agent_env_dev, S3 frontier-data-environments-dev, dev ECR, modal_vm):

    • Register: agent-env --stage dev bundle register of the same desk. The bundle carries its own copies of the ubuntu-24.04 base and the reference driver, since register refuses installed entities. Ids are fd6220-e2e-*; registration took 12.5 min.
      • The base's image was registered as the published GHCR image, pinned by digest.
      • notes and desk were composed on Modal VMs. Their amd64 container and disk forms each probed ready.
    • Run: agent-env --stage dev task run --id fd6220-e2e-together deployed the desk on modal_vm. Its together results were the expected ones above.
    • Export: agent-env --stage dev bundle init --from-task fd6220-e2e-together ran in the default mode and exited 0.
      • Written: the base computer (its pruned build context), both drivers, both apps, the desk and the check script.
      • Each env.toml keeps its environment_name, since the folders take the registry ids.
    • Outsider run: the exported folder ran on a Linux host with no hub access and an empty local store.
      • It composed and probed notes and desk from the folder, deployed the desk and ran the check.
      • The results were identical to the dev run's. Exit 0, and teardown removed its sandbox.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Computer tasks can now export their base, driver, apps, and settings into a runnable bundle folder. Installed entities stay references.

  • Computer tasks export the files needed to rebuild their desktops.
  • Computer exports keep installed entities as installed IDs.

No new actionable issues found in the follow-up changes.

Reviews (5) · Last reviewed commit: "test(bundle): computer exports in the de..." · Reviewed by Greptile

earakely-scale and others added 2 commits November 17, 2026 16:57
A computer task's bundle couldn't run without the store it came from: the computer, computer_app and
computer_driver envs and the computer artifact had no to_toml, so bundle init left the desktop in the store,
pinned. Each now writes itself out as the folder from_toml reads back: a driver's and an app's files with their
env.toml, a base computer with the image each form is built from, a computer env naming its base, driver and apps
with each app's settings beside it. What a computer env composed isn't written; a run of the folder composes it.

An entity a written entity names that comes with an installed bundle, as the shipped ubuntu-24.04 base and
reference driver do, is written as its id, as a task's own references to one already were, not copied in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne is authored

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 01:06
@earakely-scale
earakely-scale requested a review from a team as a code owner November 18, 2026 01:06
The export tests run without --include-scope user, so anything left in the store fails them. New edge tests:
a folder a run wrote back exports byte for byte as the same folder; int, float and bool settings, a
distribution's install, binary and unicode files come back as they were; a base named from a registry with a
disk built from a source; an app deployed alone; a driver two computers share, written once; and a stored
context that's gone fails the import naming the folder, writing nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit c3ea6bf into main Nov 18, 2026
39 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-6220-hb518-bundle-init-writes-computer branch November 18, 2026 03:26
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