Repository navigation
feat(computer): a versioned disk boot seed, and a reset an older launcher can't misread - #476
Merged
earakely-scale merged 3 commits intoNov 4, 2026
Conversation
…cher can't misread A disk composed by one agent-env version boots under another's launcher, so the NoCloud seed becomes a protocol, agentenv_protocol.computer.seed: the launcher writes every version it supports (user-data is version 1, unchanged; a later version N goes in user-data.vN) and the oldest it writes in agentenv-seed-oldest. The disk's init reads the newest version it knows, from boot/seed-env, which it now sources, and stops the boot, saying to recompose the disk, when the seed carries none of them. reset_vm's command first checks for the launcher's control folder, so a container an agent-env from before reset in place started is refused a reset, to be redeployed, rather than booted twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es to itself init sources seed-env before it exports the image's environment, so an image variable named reads replaced the versions it reads and skipped the seed, and one named file, name or the like was overwritten. Its variables are now local and prefixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he seed Local variables kept the image's variables safe, but a seed variable named like one of them (_seed_reads) was exported into the local and lost on return. The reader now works in a subshell and hands back only exports, each name checked and each value quoted, which seed_environment evaluates. The tests export the image's variables after sourcing the reader, as init does, and name seed variables after the reader's own; both fail on each earlier reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/fd-5170-disk-boot-protocol-version-the-launcher-guest-seed-and-the
branch
November 4, 2026 06: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.
FD-5170: a computer's disk composed by one agent-env version gets booted by later ones.
composer.pendingreuses any build recorded as ready, and disks shared through registries or HF bundles are booted by whatever version the user runs. Two contracts crossed versions with no version number: the seed the launcher hands the disk'sinit, andlaunch reset. This makes both safe across versions, with the three decisions taken in FD-5170's review. Diagrams: Disk Boot Protocol.What changes
agentenv_protocol.computer.seeddefines it.#agentenv-environmentheader, the file each version goes in, the oldest-version fileagentenv-seed-oldest, a reference writer and reader for version 1, and aSAMPLE/SAMPLE_USER_DATApair that both sides are tested against.seedwritesuser-data(v1, unchanged) andagentenv-seed-oldest=1into its own folder, with lines sorted in byte order (LC_ALL=C) so they match the spec.launchcopies that whole folder onto the CIDATA disk.user-data.vNbeside the earlier ones.initreads the newest version it knows.boot/seed-env, whichinitsources anduki.shputs in the initramfs.agentenv-init: this disk reads seed v1; this agent-env writes v2 or later; recompose it with agent-env env build.composer.pendingchanges. Only theinitknows what it reads, since a composed disk takes itsinitfrom its base disk's boot partition.RESETissh -c '[ -d /var/lib/agentenv-vm/control ] || exit 75; exec /usr/local/bin/launch reset'.launch resetfor a second boot. Its QEMU then fails to bind the forwarded ports, and the computer is left unreset.local_docker/cli.py'sdocker()now raisesDockerFailed, which carries the exit code.computers/README.mdgains the seed versions and the reset refusal.Changing
boot/changes the disk recipe's digest. So new composes, and the next release's published base disks, get new keys. Disks already composed are untouched, and they keep booting: see X1 below.Tests
seedoutput andseed-env's reader, each checked byte for byte against the protocol's sample;seed-envwith an older launcher's seed, a newer launcher's seed (user-data.v2beside v1), a seed past its versions (refused with the line above), and no user-data;RESETexiting 75 for real on a host without the control folder;reset_vmrefusal, and other failures passing through;LAUNCH, and itsCOPY;ruff checkpassed;make unit-test: 12,905 passed, 7 skipped;launcher_test.pyanddisk_boot_test.py: 2 passed.full, reset in place, ready again, and probed:init), keyb6c144d5…agentenv-seed-oldest)init), keybbf366c3…agentenv-init: this disk reads seed v1; this agent-env writes v2 or later; recompose it with agent-env env buildand powered down 2 s into bootagent-env run tst/integration/computer/disk --task probe(probe, reset in 6.6 s, probe) on its own disk.Not in this PR
initto be gone: those composed by 0.9.1422 to 0.9.1431 stop no boot.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the previous variable-name collision is fixed, and no new blocking issue was found.Summary
This PR defines a versioned disk boot seed and guards reset commands against older launchers.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Launcher writes seed files] --> B[Disk selects a supported version] B -->|Supported| C[Read values in a subshell] C --> D[Check names and quote values] D --> E[Apply exports in init] B -->|Too new| F[Stop boot with recompose message] G[Provider requests reset] --> H{Control folder exists?} H -->|Yes| I[Run launch reset] H -->|No| J[Refuse reset and request redeploy]Reviews (3) · Last reviewed commit: "fix(computer): the seed reader shares no..." · Reviewed by Greptile