Skip to content

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 into
mainfrom
edgararakelyan/fd-4382-m18-snapshot_env-on-envs-without-a-gateway
Nov 1, 2026
Merged

earakely-scale merged 10 commits into
mainfrom
edgararakelyan/fd-4382-m18-snapshot_env-on-envs-without-a-gateway

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

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_env without 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.
  • A file tree is kept file by file. An environment whose card declares that data/get returns a file tree (urn:agentenv:intake/v1, format file-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 in task_steps/computer/, is snapshot_env with the computer's file_paths passed as data/get's paths. By default those are the folders the computer's card declares (Desktop, Documents, Downloads). It writes the same environment universe snapshot_env does.
  • A computer env loads its snapshot back. load_environment_artifact writes the files at their paths under the session user's home through the driver's data/add, so load_artifact of a computer's snapshot restores it.
  • An env that can't reach the store under the upload grant is asked again without the grant, and returns its export inline.

Issue: FD-4382 (M1.8). Design: Environment Artifacts With Several Files, section "After it lands".

How

  • No gateway. execute takes a record with a recorded card in place of a gateway URL. snapshot_env_state then 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_file asks data/get under a grant of FILE_TREE_LIMITS (100,000 objects, 50 GiB in all) and returns its answer. export_one then writes the files (_file_tree_files), 8 at a time:

    • a file uploaded under the grant is registered where it was put, with no download;
    • any other file is written from its inline bytes;
    • each file's id is 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_state takes data_get_params for every environment's data/get, which is how snapshot_computer_env passes paths.

  • snapshot_computer_env.

    • Its fields: env_id, env_instance_id, env_step_id, snapshot_id, file_paths, export_timeout_seconds.
    • Refused before a run: an env that isn't a computer env, and file_paths that aren't normalized paths relative to the home.
    • It picks the deployment and names the snapshot as snapshot_env does, and records under env_snapshotted_universes.
  • ComputerEnv.

    • load_environment_artifact takes the computer's own environment artifact and writes its files at their paths through inside.add_artifacts, the path load_file_artifact_universe already 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_artifact loads the universe's environment named after the computer, and leaves any other out with a warning.
  • The retry (snapshot_env.get_data): a data/get that 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

  • A computer's apps (M1.4, FD-4369): their exports in the computer's snapshot, and loading a universe's app environments into them. Today those are left out with a warning.
  • An environment that returns several parts without declaring a file tree is still kept as its first part, as before.
  • 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_env without a gateway:
    • each child on a recorded card is reached and kept as one file;
    • the env itself is reached when the card has no children;
    • a file tree is kept file by file by its paths, under a 100,000-object grant;
    • an env failing under the grant is asked again without it, and one failing with no grant is asked once;
    • execute end to end.
  • snapshot_computer_env:
    • its fields round-trip and it's registered;
    • non-relative file_paths and an env that isn't a computer are refused before a run;
    • inline files are kept by their paths, with file_paths sent as paths or nothing;
    • uploaded files are kept where the computer put them;
    • the retry without the grant;
    • a run on an env that isn't a computer, or with no files, is refused.
  • 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_db is the type that's refused.

Integration, laptop (local Docker, localhost:5000), on the shipped desktop computer:

  • A computer with no network. It's given a file in Downloads and one written to Desktop, then snapshotted with file_paths = ["Desktop", "Downloads/note.txt"].
    • Its upload under the grant fails, it's asked again, and exactly those two files come back inline.
    • After a reset removes them, load_artifact of the snapshot writes Desktop/left.txt back.
  • An open computer with files in Documents/reports and Downloads, 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

RetriggerView in GreptileConfidence 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.

  • Environment snapshots can follow a deployment card without a gateway.
  • Computer files can be saved and restored as separate files at their original paths.
  • Computer environments can combine apps in their listed order.
  • OpenEnv servers can require a bearer token for requests and WebSocket connections.
  • verl can train on OpenEnv tasks through an agent loop and generated datasets.
  • Protocol version and timing-related test edits leave product behavior unchanged.

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]
Loading

Reviews (3) · Last reviewed commit: "Merge the earlier branch head into the r..." · Reviewed by Greptile

…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>
earakely-scale and others added 6 commits October 31, 2026 12:14
…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>
@earakely-scale earakely-scale changed the title feat(snapshot): snapshot envs without a gateway, keeping each environment's export as its data/get returned it feat(snapshot): snapshot envs without a gateway, and a computer env's files with snapshot_computer_env Oct 31, 2026
earakely-scale and others added 3 commits October 31, 2026 18:01
… 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 earakely-scale changed the title feat(snapshot): snapshot envs without a gateway, and a computer env's files with snapshot_computer_env feat(snapshot): snapshot envs without a gateway, keep a file tree's files, and load a computer's snapshot back Nov 1, 2026
@earakely-scale
earakely-scale merged commit 434dab0 into main Nov 1, 2026
26 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-4382-m18-snapshot_env-on-envs-without-a-gateway branch November 1, 2026 01:34
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