Repository navigation
feat(bundle): bundle init writes computer envs into the folder - #757
Merged
earakely-scale merged 3 commits intoNov 18, 2026
Merged
earakely-scale merged 3 commits into
earakely-scale merged 3 commits into
Conversation
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
marked this pull request as ready for review
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
deleted the
edgararakelyan/fd-6220-hb518-bundle-init-writes-computer
branch
November 18, 2026 03:26
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.
What
agent-env bundle initcan now write computer envs into the bundle folder, so a computer task's bundle runs with no store.Before, the
computer,computer_appandcomputer_driverenvs and thecomputerartifact hadfrom_tomlbut noto_toml.bundle inittherefore left the desktop out of the folder:--include-scope user, the import failed;Now each type writes itself out as the folder its
from_tomlreads back:computer_driver: its files, plusmodule,port(when not the default),installandknown_failures.computer_app: its files, plusenvironment_name,module,computeranddriver(when it names them),build_settingsandsettings.computerenv:environment_name,computer,driver, andapps. An app with default settings is written as a table with itssettingsbeside it. Alsodisplay,network,computer_settingsandtools.computerartifact:description,arch,os,session,formsandconfig. Each form's image is written asbundle initwrites 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.04base andreferencedriver 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-taskoutput, so anyone can run them withagent-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):linux/ubuntuinstall, binary files and unicode file names come back as they were.artifacts/base, and writes nothing.tst/unit/bundleandtst/unit/env: 3,874 passed, 1 failed. The failure,test_disk_recipe.py::test_a_windows_install_boots_its_iso_first…, also fails onmainon macOS.ruff check: clean.End to end on Linux (x86_64, real Docker, local stores):
appbundle, tasktogether. The desk has thenotesandclockapps, and its driver is a copy ofreference. Exit 0.agent-env bundle init --from-task <its id>, without--include-scope user. Exit 0. Written:envs/desk-driver,envs/notes,envs/clock,envs/deskandartifacts/check_desk, each with its files. Floating: the shippedubuntu-24.04andreference, as their installed ids. Nothing was pinned.agent-env run <the folder> --task togetheragainst a fresh state dir. Exit 0.togethercheck's results were identical in both runs, and equal to whattst/integration/computer/computer_app_test.pyexpects:{"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, S3frontier-data-environments-dev, dev ECR,modal_vm):agent-env --stage dev bundle registerof the same desk. The bundle carries its own copies of theubuntu-24.04base and thereferencedriver, since register refuses installed entities. Ids arefd6220-e2e-*; registration took 12.5 min.notesanddeskwere composed on Modal VMs. Their amd64 container and disk forms each probedready.agent-env --stage dev task run --id fd6220-e2e-togetherdeployed the desk onmodal_vm. Itstogetherresults were the expected ones above.agent-env --stage dev bundle init --from-task fd6220-e2e-togetherran in the default mode and exited 0.environment_name, since the folders take the registry ids.notesanddeskfrom the folder, deployed the desk and ran the check.🤖 Generated with Claude Code


Confidence 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.
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