Skip to content

docs(guides): add Cloudflare Sandbox migration guide - #389

Draft
NathanFlurry wants to merge 2 commits into
mainfrom
migrate-cloudflare-sandbox
Draft

NathanFlurry wants to merge 2 commits into
mainfrom
migrate-cloudflare-sandbox

Conversation

@NathanFlurry

Copy link
Copy Markdown
Member

What this adds

  • A guide at /guides/migrate-cloudflare-sandbox that maps the Cloudflare Sandbox SDK to a Rivet Actor that owns one sandbox through @rivet-dev/sandbox-adapter. It covers identity by key, exec and streamed output, background processes, files, git checkout, running code, preview URLs, and sleep and destroy, plus a concept map and the differences to plan for.
  • A type-checked example in examples/docs/migrate-cloudflare-sandbox/ (server.ts, client.ts). It stores the sandbox id in SQLite and the connected sandbox in c.vars, shares one in-flight open across concurrent actions, and uses no actor state, queues, or KV.
  • A "Migrations" guides group in docs/sidebar.json. It merges with the Actors bundle's group of the same name on rivet.dev.

Gaps documented in the guide

There is no adapter API for shell sessions, binary writes, waitForPort, terminals, snapshots, file watching, or bucket mounts. The guide points to provider SDKs or exec patterns for these. Preview URLs call the provider SDK directly (E2B getHost in the example).

Notes

  • Ported from docs(guides): add Cloudflare and PartyKit migration guides rivet#4389, which targeted the old website cookbook and the Sandbox Agent HTTP SDK. This version targets the current sandbox adapter.
  • The guide lives in the Agents bundle because the Sandbox Agent bundle has no guides section.
  • Checks: pnpm exec tsc --noEmit -p examples/docs passes, and Biome is clean on the changed files.

🤖 Generated with Claude Code

Map the Cloudflare Sandbox SDK to a Rivet Actor that owns one sandbox
through @rivet-dev/sandbox-adapter: identity by key, exec and streaming
output, background processes, files, git, code runs, preview URLs, and
sleep and destroy. The example keeps the sandbox id in SQLite and the
connected sandbox in vars, and is type-checked in examples/docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@railway-app

railway-app Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🚅 Environment agents-pr-389 in rivet-frontend has no services deployed.

3 services not affected by this PR
  • sentry-tunnel
  • kitchen-sink
  • mcp-hub

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

📟 Pip-Boy · a35ab1f

📦 Packages

Skipped: this PR doesn't change any published package.

🧹 Rust dependencies

Skipped: this PR doesn't change any Rust code or dependencies.

🦀 Binaries

Skipped: this PR doesn't change any Rust code.

⏱ Timing

job wall time slowest step
changes 17s checkout · 13s
zizmor 15s checkout · 9s
report 25s checkout · 8s
⏭ native · ${{ matrix.platform }} — skipped
⏭ footprint — skipped
⏭ hygiene — skipped
⏭ self-test — skipped
🔭 Full CI trace for this commit

One OpenTelemetry trace of CI and Pip-Boy for a35ab1f: every job and step, with the sizes above attached. Run after CI finishes.

pnpm install --frozen-lockfile --filter 'pipboy...'
pnpm --filter pipboy pipboy trace --sha a35ab1ffbff6cc28ef8f76ed14cf4d0ac3c947df

Add --otlp <url> to send it to any OTLP/HTTP collector.

Agent instruction: From a rivet-dev/agents checkout, run the commands above, then read the trace file the last command prints. List the slowest jobs and steps and explain where CI time went.

- Pass the git token in a `-c` http.extraHeader setting so it is not
  saved in the clone's .git/config, and say it is visible in the sandbox
  while the clone runs.
- Note that Daytona cannot stop a running command or stream its output.
- Take the exec timeout per call and say to raise it with actionTimeout.
- Give each execStream call its own id in output events.
- Delete files with `rm -f`, and remove runPython's snippet after the run.
- Say dockerPortAddress needs the `ports` option, and that Freestyle and
  agentOS have no port helper.
- Title the sidebar entry "From Cloudflare Sandbox".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant