Sandboxes
Manual tests for sandbox lifecycle: create, suspend and wake, update, recreate, snapshots and providers.
Manual tests for sandbox lifecycle: create, suspend and wake, update, recreate, snapshots and providers.
Run these against the provider you changed. Locally that’s Docker; for Runtime Cloud or Blaxel, point a local install at the provider with its keys (see Sandboxes). RUN_DOCKER_TESTS=1 vendor/bin/pest tests/Integration covers much of this for Docker; run it first.
X-Frame-Options: SAMEORIGIN (a Rails app), and another that checks for a frame in its own code (NocoDB).curl -I still shows the Rails app’s X-Frame-Options.SameSite=None and Secure, not Partitioned, and there’s an __onedrop_unpartitioned cookie. With third-party cookies blocked (Chrome settings), they show Partitioned too and there’s no __onedrop_unpartitioned.curl -I shows the app’s Set-Cookie unchanged.docker ps shows the container paused; after five more minutes, stopped.docker stop its container (as the idle check does): within about 20 seconds, without touching the page, the container is running again and the preview reloads to the app./projects/{id}/sandbox/activity stop (browser network tab) and the sandbox is suspended once idle (E2B: paused about 10 minutes later in its console). Click the page: the sandbox wakes and the preview reloads.docker ps -a shows both containers exited (about 6 minutes), then docker container prune -f.docker/sandbox (a guide, say), without rebuilding the image./opt/onedrop, and nothing else changed.docker/sandbox and to the Dockerfile’s COPY … /opt/onedrop/ line, again without rebuilding: the new file and any other changed tool file still go in (a COPY-only Dockerfile change isn’t a base change). On production, cloud tinker → app(App\Sandbox\SandboxTools::class)->compare(app(App\Sandbox\SandboxProvider::class), '<external id>') shows "base": true.start.sh), rebuild with php artisan sandbox:build-image, then run php artisan sandbox:update <project>.node_modules, App Storage, the agent’s conversation (the next message continues it), and anything installed in /home/sandbox.php artisan sandbox:recreate <project> --keep-files gives a new sandbox with everything above kept.--keep-files, the code comes back from its backup, every branch included.php artisan sandbox:restore <project> --list lists snapshots, and restoring an older one brings back that state.workspace layer again.deps layer again.SANDBOX_SNAPSHOT_DISK), layers go straight to the bucket.With Docker inside sandboxes on for the provider:
docker-compose.yml starts its stack, and Services shows it.With a GitHub OAuth app set (GITHUB_CLIENT_ID), as someone whose GitHub account can see a private ghcr.io image and a private npm package:
GITHUB_TOKEN; cat ~/.docker/config.json ~/.npmrc shows "ghcr.io": "onedrop" and ${GITHUB_TOKEN}, never the token itself.docker pull ghcr.io/<owner>/<private image> works, and so does docker compose up in a project that uses it (e.g. Pixwel/platform).npm config set @<scope>:registry https://npm.pkg.github.com && npm view @<scope>/<private package> version works.GITHUB_TOKEN under From (your name)‘s GitHub.GITHUB_TOKEN, the two config entries are gone, and docker pull of the private image is refused.GITHUB_TOKEN, the Shell has the secret’s value instead.With Docker inside sandboxes on, in a project whose compose stack has a database (Mongo or Postgres) storing its files in the workspace (e.g. ./tmp/mongo:/data/db):
docker ps in Main’s Shell shows none Paused).build: section), the copy’s preview comes up without building it again: docker images in the copy’s Shell lists it, and its Console shows no build steps for it.images folder on the snapshot disk)./workspace, e.g. Pixwel/platform) is made without the queue worker crashing: the files go through the bucket (a tasks/<id>/copy-… folder appears under the project’s snapshot folder while it’s made, and is gone after), and the copy’s database files keep their container user’s owner (ls -ln tmp/mongo matches Main).In a project connected to a GitHub repository (with the GitHub App), with Main a few commits behind and some uncommitted changes:
In a project connected to a GitHub repository whose branch has a .onedrop/dev:
.onedrop/dev has it up; Shell and Files are the task’s copy.With E2B_API_KEY set and the template built (SANDBOX_PROVIDER=e2b php artisan sandbox:build-image), put E2B first in Settings → Sandboxes.
docker info in the Shell says overlayfs; importing Pixwel/platform, the agent starts its whole Compose stack (API, MongoDB, Redis, Elasticsearch, workers) and the preview shows the app.https://<port>-<id>.e2b.app/) is refused (403).echo $PATH ends in /opt/onedrop/lazy, and asking the agent to docker pull a private ghcr.io image of theirs works.resumed until you return); coming back reloads the preview and the Shell is on the same session.sleep 900 && echo done in the Shell tool, or a big install) and close the tab: the sandbox stays running until the run ends, then pauses within about a minute and a half.On a local install with SANDBOX_CALLBACK_URL=http://host.docker.internal:8000, cloudflared installed, and E2B turned on and first in Settings → Sandboxes.
composer run dev./login, in a browser gives 404.composer run dev while that agent is working: a new tunnel address is printed, and the chat keeps streaming the same turn.composer run dev without cloudflared on the PATH), then send another message: the chat replies at once that the sandbox can’t reach OneDrop, and the project isn’t left on Thinking….Use an install with two remote providers set up (Runtime Cloud and Blaxel) and a bucket as the snapshot disk, on a Flex queue (production, or a staging environment on Laravel Cloud). Have two projects on Runtime: one with a database the agent set up in /home/sandbox, one with a Shell open.
node_modules, App Storage, the database’s data, and the agent’s conversation (the next message continues it).npx withruntime sandbox ls no longer lists the old sandboxes.ps aux and freeze it with sudo kill -STOP <pid> (the Shell goes too). A sandbox stuck in Runtime’s resuming state, as project 45 was on 2026-10-09, is the real case.nprocmain that changes docker/sandbox, the sandbox image workflow runs after images and Settings shows a new E2B build.