Repository navigation
fix(env): a file universe loaded onto a lone server's container lands in it - #735
Merged
earakely-scale merged 2 commits intoNov 17, 2026
Conversation
… in it Env.load_file_artifact_universe assumed a VM sandbox, staging with exec_script and load_object_file. A server env's sandbox is its own container: on Modal the load died with "'ModalSandbox' object has no attribute 'exec_script'", and on local Docker the files went to this machine, where the server can't see them. A container-mode sandbox is now written through stage_files_into_container, as an agent's container is; a VM is loaded on its host as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the sandbox contract says Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
marked this pull request as ready for review
November 17, 2026 07:19
earakely-scale
deleted the
edgararakelyan/fd-5994-load_artifact-of-a-file-universe-dies
branch
November 17, 2026 18:32
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
load_artifactof a file or aFileArtifactUniverseonto a server env (env_provider_type = "server") now writes the files into the server's container.Fixes FD-5994. Every run of
fna1-doc-tools-smoke-muse(framework 0.9.1546) died atload_artifactwith:Why it broke
Env.load_file_artifact_universe, the defaultMCPServerEnvuses, assumed its sandbox is a VM: it ranexec_scriptandload_object_file, which onlyVmSandboxhas. A server env's_sandboxis its own container (_SandboxEnvironmentProvider._reattach).ModalSandbox, so the load crashed.LocalSandboxin container mode, whoseexec_scriptruns on this machine. The load succeeded, but the files landed on the host, where the server can't see them.The change
A sandbox in container mode is staged with
stage_files_into_container, the helper an agent's container and a containerdeploy_sandboxalready use:exec mkdir -pandwrite_file_from_object.docker exec -u 0 <container> mkdir -panddocker cp.A VM-mode sandbox (the gateway provider's) takes the same path as before, unchanged.
Behaviour change: on local Docker, a server env's files now go into its container instead of onto the host. Nothing could use them on the host; this matches Modal and how
MCPServerEnvalready stages environment artifacts in container mode.Tests
tst/unit/env/load_file_artifact_universe_test.py, three tests:docker exec;server_env_local_test.py::test_files_a_task_loads_onto_a_server_env_land_in_its_container: the realload_artifactstep loads a file and a universe with a nested file onto a local server env, then reads each file back inside the server's container.server_env_modal_test.py::test_files_a_task_loads_onto_a_modal_server_env_land_in_its_container: the same on Modal. It is gated byskip_without_remote_sandbox("modal").Verification
On an x86 Linux host with Docker and a local registry (the branch, then the same tests against main's
env.py):load_file_artifact_universe_test.pyAttributeError: Mock object has no attribute 'exec_script'(the reported error); the local container case loaded onto the hosttest_files_a_task_loads_onto_a_server_env_land_in_its_containercat: /tmp/docs/note.txt: No such file or directoryin the container; the files were on the host at/tmp/docsserver_env_local_test.py(7 tests)test_container_sandbox_files_local.py(3 tests: the shared staging helper on local)task_steps_test.py::test_load_artifact_stages_files_into_env_and_agent(gateway env on a VM, and an agent)tst/unitand the protocol tests)About the full unit tier:
test_load_artifact_file.py::test_into_a_deployed_env: its stand-in sandbox had nomode, which the sandbox contract requires ("vm"for a VM). The second commit gives it one, and the file passes.version_lookup_benchmark_test.py: it needs a git checkout, which the shipped copy didn't have. It passes in a clone.hidden_by_default_test.pyfails even on its own and takes its xdist worker down with it, so the tier ran withulimit -n 65536.Not run by hand: the Modal e2e. CI's Integration Tests job doesn't collect
server_env_modal_test.py, and the run needs Modal credentials.🤖 Generated with Claude Code


Confidence Score: 5/5
This PR appears safe to merge; container loads reach the intended container, and VM loads keep their existing behavior.Summary
File loads now write into an env’s own container when its sandbox uses container mode. VM loads keep their existing behavior.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Env loads file universe] --> B{Sandbox mode} B -->|container| C[stage_files_into_container] C --> D{VM-hosted container?} D -->|Yes| E[Create directories with docker exec and copy files] D -->|No| F[Write directly into container] B -->|vm| G[Create directories and load files on VM host] E --> H[Return destination paths] F --> H G --> HReviews (1) · Last reviewed commit: "test(load_artifact): the deployed env's ..." · Reviewed by Greptile