try-works/role-model / .agents/skills/sandbox-2026-deprecation
sandbox-2026-deprecation
VerifiedMigrate Cloudflare Sandbox SDK codebases away from features deprecated in June 2026 (HTTP and WebSocket transports, desktop, exposePort, default sessions, and stream-specific file and command APIs).
Sandbox SDK 2026 deprecation migration
Use this skill when migrating a codebase that depends on the Cloudflare Sandbox SDK away from features deprecated in June 2026.
For the announcement, refer to the changelog entry. For detailed documentation, refer to the migration guide.
Migration checklist
-
Update
@cloudflare/sandboxand the sandbox container image before changing runtime configuration. -
Search the codebase for deprecated configuration and APIs:
rg 'SANDBOX_TRANSPORT|transport:|exposePort\(|enableDefaultSession|execStream\(|readFileStream|writeFileStream' -
Switch every sandbox to RPC transport with
SANDBOX_TRANSPORT=rpcorgetSandbox(..., { transport: "rpc" }). -
Replace Sandbox SDK desktop APIs with Cloudflare Browser Run where browser automation is required.
-
Replace
exposePort()withsandbox.tunnels.get(). Use quick tunnels for development and named tunnels for stable production hostnames. -
Set
enableDefaultSession: falseongetSandbox(). -
Replace workflows that depend on persisted shell state with explicit sessions from
sandbox.createSession(). -
Move stream-specific file and command logic to the base
readFile(),writeFile(), andexec()APIs where streaming behavior is supported. -
Deploy the Worker and smoke-test command execution, file operations, public URLs, and stateful session workflows.
API replacements
| Deprecated feature | Replacement |
|---|---|
| HTTP or WebSocket transport | RPC transport |
| Sandbox SDK desktop | Cloudflare Browser Run |
exposePort() | sandbox.tunnels.get() |
| Default sessions | enableDefaultSession: false with explicit sessions |
| Stream-specific command and file helpers | Base command and file APIs with streaming support |
Notes for agents
- Do not remove
exposePort()blindly if the Worker usesproxyToSandbox()to inject authentication or rewrite responses. Preserve that behavior before moving traffic to tunnels. - If code relies on
cdcarrying across separateexec()calls, create an explicit session withcwdinstead. - Tunnels require RPC transport. Configure RPC before migrating public URLs.
- Large or binary file streaming requires RPC transport.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |