Repository navigation
feat(snapshot): snapshot envs without a gateway, keep a file tree's files, and load a computer's snapshot back - #423
Merged
earakely-scale merged 10 commits intoNov 1, 2026
Conversation
…ment's export as its data/get returned it snapshot_env reaches an env deployed without a gateway, a computer env say, through the card its deployment recorded, and snapshots the environments the card lists as children, or the env itself. An export one file can't keep, several parts or the files of an env whose card declares its data/get returns a file tree, is stored as its parts (EnvironmentArtifact.parts: each part's kind, content, name, media type and metadata), so data/add can be handed them back; any other export is written exactly as before. computer_file_paths names what a computer env's own data/get returns. The snapshot grant allows a file tree's files, uploaded each where the computer put it, and a computer whose network keeps it from the store is handed none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment's export as its data/get returned it snapshot_env reaches an env deployed without a gateway, a computer env say, through the card its deployment recorded, and snapshots the environments the card lists as children, or the env itself. An export one file can't keep, several parts or the files of an env whose card declares its data/get returns a file tree, is stored as its parts (EnvironmentArtifact.parts: each part's kind, content, name, media type and metadata), so data/add can be handed them back; any other export is written exactly as before. computer_file_paths names what a computer env's own data/get returns. The snapshot grant allows a file tree's files, uploaded each where the computer put it, and a computer whose network keeps it from the store is handed none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A data/get answer may hold text parts too; one with a data part then a text part read the text part's data and failed the snapshot, and a lone text part did before this change. A text part is kept as a part of kind text, its text stored as a .txt file, so data/add can be handed it back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r_env names a computer's files snapshot_env drops computer_file_paths. Its core takes more data/get params by environment name, passed as they are (never write_namespace, which it sets itself), and the step fills them from _data_get_params, empty for any env. The new snapshot_computer_env (task_steps/computer/) subclasses it with a typed file_paths, relative to the session user's home, sent as paths to the computer's own data/get only; an env that isn't a computer, and paths that aren't relative, are refused before a run. The protocol client's get_data takes extra params the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fails under it, instead of reading a computer's network The generic snapshot no longer reads a computer's recorded network to withhold its grant. An env whose data/get fails under the grant, one that can't reach the store such as a computer whose network is closed, is asked once more without it and returns its export inline; a failure without a grant is reported as before. inside.py is as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ter_env keeps a computer's files as a FileArtifactUniverse EnvironmentArtifact, EnvironmentUniverseArtifact and the protocol client are as on main. snapshot_env keeps one file per environment, as through a gateway, and refuses an environment whose data/get returns a file tree, pointing to snapshot_computer_env. That step writes a computer env's files into a FileArtifactUniverse by their paths, each upload under its grant written in place and any other file from its inline bytes, the computer asked again without the grant when it fails under it; load_artifact loads the universe back into a computer. Its fields are its own: no gateway, trajectory or changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed tree Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… files with snapshot_computer_env The branch's change rebased onto main as one commit: snapshot_env reaches an env deployed without a gateway through the card its deployment recorded; a new snapshot_computer_env step keeps a computer env's files; an env failing data/get under the upload grant is asked again without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and load a computer's snapshot back into it Built on environment artifacts of several files (#424): - snapshot_env keeps an environment whose card declares a file tree, a computer's, file by file by its paths in its environment artifact, under a grant sized for a file tree, instead of refusing it. Each file is written as derive_path_id(<snapshot>-<environment>, path). snapshot_env_state takes data_get_params for every environment's data/get. - snapshot_computer_env is snapshot_env with the computer's file_paths as data/get's paths, and writes the same environment universe snapshot_env does, in place of a FileArtifactUniverse. - A computer env loads an environment artifact, its own, by writing its files at their paths under the session user's home through the driver's data/add, and a universe by loading its own environment and leaving the others out with a warning. load_artifact of a computer's snapshot so restores it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed tree Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/fd-4382-m18-snapshot_env-on-envs-without-a-gateway
branch
November 1, 2026 01:34
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
Snapshots reach envs deployed without a gateway, and a computer env's files can be snapshotted and loaded back into it. This is built on environment artifacts of several files (#424).
snapshot_envwithout a gateway. It reaches an env through the card its deployment recorded, and snapshots the environments that card lists as children, or the env itself when it lists none. Before, any record without a gateway was refused.data/getreturns a file tree (urn:agentenv:intake/v1, formatfile-tree, as a computer's does) is kept in its environment artifact, each file by its path, under an upload grant sized for a file tree. Every other environment is still kept as one file, exactly as before.snapshot_computer_env, a new step intask_steps/computer/, issnapshot_envwith the computer'sfile_pathspassed asdata/get'spaths. By default those are the folders the computer's card declares (Desktop, Documents, Downloads). It writes the same environment universesnapshot_envdoes.load_environment_artifactwrites the files at their paths under the session user's home through the driver'sdata/add, soload_artifactof a computer's snapshot restores it.Issue: FD-4382 (M1.8). Design: Environment Artifacts With Several Files, section "After it lands".
How
No gateway.
executetakes a record with a recorded card in place of a gateway URL.snapshot_env_statethen lists the card's environments (_card_environments) instead of the env's MCP servers, and the existing helpers resolve each environment's address from the stored card.File trees. For an environment whose card declares a file tree,
_export_environment_to_fileasksdata/getunder a grant ofFILE_TREE_LIMITS(100,000 objects, 50 GiB in all) and returns its answer.export_onethen writes the files (_file_tree_files), 8 at a time:derive_path_id(<snapshot>-<environment>, path).The files go into the environment's artifact by path. A part naming no path, or no files at all, fails that environment with a clear message.
data_get_params.snapshot_env_statetakesdata_get_paramsfor every environment'sdata/get, which is howsnapshot_computer_envpassespaths.snapshot_computer_env.env_id,env_instance_id,env_step_id,snapshot_id,file_paths,export_timeout_seconds.file_pathsthat aren't normalized paths relative to the home.snapshot_envdoes, and records underenv_snapshotted_universes.ComputerEnv.load_environment_artifacttakes the computer's own environment artifact and writes its files at their paths throughinside.add_artifacts, the pathload_file_artifact_universealready uses. It uses read grants when the store's grants reach the computer and its network allows it, and inline bytes otherwise. Files already there that aren't in the artifact stay.load_environment_universe_artifactloads the universe's environment named after the computer, and leaves any other out with a warning.The retry (
snapshot_env.get_data): adata/getthat fails under the grant, as a computer whose network is closed does, is asked once more without it. A failure without a grant is reported as before.Not in this PR
prompt_agent's periodic env snapshots still skip an env without a gateway (env_has_no_gateway_url).Testing
Unit: 12,337 passed, none failed, on macOS. New and extended tests:
snapshot_envwithout a gateway:executeend to end.snapshot_computer_env:file_pathsand an env that isn't a computer are refused before a run;file_pathssent aspathsor nothing;ComputerEnv: a snapshot of its files loads back at their paths, leaving out another environment with a warning. An environment or universe not named after the computer is refused before anything is sent.load_artifact: a computer env now passes the save-time check for loading an environment universe;service_dbis the type that's refused.Integration, laptop (local Docker,
localhost:5000), on the shipped desktop computer:Downloadsand one written toDesktop, then snapshotted withfile_paths = ["Desktop", "Downloads/note.txt"].load_artifactof the snapshot writesDesktop/left.txtback.Documents/reportsandDownloads, snapshotted with its card's folders. Each file is uploaded under the grant and kept at its object URL, with the bytes intact.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issue was established.Summary
The PR adds snapshots for deployments without a gateway and preserves computer files by path.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Deployed environment] --> B{Gateway available?} B -->|Yes| C[List environment services] B -->|No| D[Read recorded card] C --> E[Request current data] D --> E E --> F{File tree?} F -->|Yes| G[Save each file by path] F -->|No| H[Save one environment file] G --> I[Create environment universe] H --> I I --> J[Load into matching environment]Reviews (3) · Last reviewed commit: "Merge the earlier branch head into the r..." · Reviewed by Greptile