Packages

@cloudflare/sandbox

1.0.3 · 22 Oct 2026Apache-2.02.1M / weekRepositoryHomepagenpmAtom feed

Your version

0.12.12

20 Oct 2026Where it was published

0.12.14 is the newest release of 0.12.x.

In short

11 fixed

Release note

Patch Changes

  • Fix mountBucket() breaking an existing mount when a second call for the same mount path fails with "already in use". The existing mount now stays mounted and usable.

  • Keep streaming exec() alive while a command is quiet, and enforce its timeout. Quiet commands were cut off after about four minutes on the HTTP transport and five on WebSocket. The timeout was ignored on those transports, and on every transport for commands that run in a session. Requires the matching container image.

  • Keep R2 binding and credential-proxy bucket mounts working when the Sandbox Durable Object restarts while its container keeps running. The mounts used to stay listed but fail every read and write with EIO until mountBucket() was called again.

  • Fix createOpencodeServer() and createOpencode() waiting for the full three-minute startup timeout when OPENCODE_SERVER_PASSWORD is set. When the password is passed in env, the client returned by createOpencode() now authenticates with it.

  • Create the s3fs password file for mountBucket() with mode 0600 from the start. The file used to be readable by other users in the container until a chmod a moment later, long enough for a non-root process to open it and read the bucket credentials. Upgrade the container image together with the SDK to close the gap; with an older image, mounts work as before.

  • Answer a preview request with 502 when the app's port in the container fails, for example because nothing listens on it or it closes the connection, and log the original error. Previously the error escaped the Sandbox, proxyToSandbox() answered 500 Proxy routing error, and the log blamed a platform runtime update.

  • Forward WebSocket upgrades on preview URLs with Host: localhost:<port>, like every other preview request. Dev servers that check the Host header, such as Vite, no longer reject HMR connections. The public hostname is still in X-Forwarded-Host.

  • Keep preview URLs and tunnels working on the RPC transport after the control connection reconnects. The connection closes after 1 second without calls, and the next call used to rerun the sandbox's start handling even though the container was still running. Preview URLs then returned 410 STALE_PREVIEW_URL, getExposedPorts() returned an empty list, quick tunnels disappeared from tunnels.list(), and tunnels.get() could fail with "Tunnel recovery attempts were exhausted".

  • Stop the first call on the RPC transport from failing when Cloudflare can't provide a container right away. The call now keeps waiting for the container within its retry window.

  • Stop the container server from crashing with ENOENT: no such file or directory, watch '…/<id>.log.stderr' while commands run. The crash killed every process in the container. Update the container image to pick up this fix.

  • tunnels.get() on the RPC transport now reports the real tunnel error, such as cloudflared failing to start or missing from the image, instead of "Tunnel recovery attempts were exhausted". It also no longer leaves a port stuck after giving up: a cloudflared left running from an earlier attempt is stopped and replaced. Replacing it needs the matching container image.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.