Status: design only — NOT implemented as of 2026-08-06. The shipped Coder is local-runner-only:
CodingSessionWorkflowresolves a local runner via the relay (getRunnerConn) and has no cloud/managedcode path; theinstance_runtimes.placementcolumn exists but nothing routes on it, and there is no Cloudflare Sandbox integration inworkers/api/src. The GCP cloud-VM roadmap was dropped (CF has no persistent shell host — self-hosted runner only). This doc is forward-looking design, gated on the CF Sandbox SDK (beta) and on the current agents being solid first. Seecloudflare-agent-stack-2026.md§2.
Goal: let a coding session run on the user's machine (today) OR in the cloud
(new) — a per-session/per-repo choice. Maps onto the existing
instance_runtimes.placement field (local | managed).
- No window / server-side: yes. The cloud option runs in a Cloudflare Sandbox (server-side). Nothing to SSH into; the coding CLI runs as a process.
- Blind / autonomous-only: no. You still see + drive it through the console
— the same Summary co-pilot + Terminal view; the worker routes
/captureand/captureand action routes to the sandbox instead of the local relay. You can read output, send messages, and take over. Headless only means "no window on your machine."
Local (pags up) |
Cloud (CF Sandbox) | |
|---|---|---|
| CLI auth | machine's claude login (Max/Pro) |
BYOK Anthropic API key (no local login) → pay-per-token |
| Repo | your real local checkout (branch/changes/deps) | fresh git clone from GitHub (private → GitHub App token) |
| Deliverable | edits in your working tree, live in your editor | a branch + PR (nowhere local to leave changes) |
| Lifetime | while machine + pags up run |
managed/ephemeral; CF Sandbox timeout/persistence beta, unspecified → task runs, not indefinite sessions |
| Best for | hands-on dev on your code | autonomous "do X on owner/repo, open a PR" while away |
Two to make loud in the UI: cloud costs tokens (your API key) and cloud produces a PR, not local file edits.
- Console session view unchanged — already polls
/capture+ drives/act; agnostic to where the runtime lives. - Add a placement choice at session start: Run on → My machine | Cloud.
placement: 'local'-> today's path (pags upover the outbound relay).placement: 'managed'→ new cloud coding runtime:CodingSessionWorkflowdrives a CF Sandbox (clone repo → launch the CLI with the BYOK key → expose snapshot/act) instead of the local runner. Samecoding_timelinepersistence.- The runtime resolution (
lib/runner-client.ts/getRunnerConn) gains a managed branch: forplacement='managed', talk to the platform-held Sandbox instead of the user's local relay connection.
- Sandbox persistence/timeout — how long does an interactive coding session survive? (Beta, undocumented.) Determines: real sessions vs one-shot tasks only.
- Interactivity — can we keep a CLI process alive + stream its terminal, or is it request/response (clone → task → diff)? If the latter, cloud = "objective → PR" only (no live takeover), and the UI should say so.
- Cost — per-Sandbox + per-token (BYOK). Show the user it's metered.
- PR flow — branch naming, commit, push via GitHub App token, open PR.
Recommended next step: spike one CodingSessionWorkflow run against a CF
Sandbox (clone → run Claude Code with the BYOK key → stream /capture → open a PR)
to measure (1) and (2) before committing to the full placement toggle.