v0.19.2
Sandbox v0.19.2 makes blob-backed disks much cheaper to acquire and more reliable to mount.
Acquiring a new volume now performs only the conditional lease create. It does not write disk blocks or pre-format the filesystem. Sparse ext4 provisioning happens lazily when the disk is first attached, so acquisition latency is close to the object store's own conditional-write latency. In testing against Cloudflare R2, a new 4 GiB volume acquired in 348–382 ms instead of 5–11 seconds; local acquisition takes 5–8 ms.
Mount paths no longer need to be baked into the rootfs. Sandbox creates missing directories during boot, follows symlinks within the guest root, and keeps read-only rootfs images unchanged:
import { block, defineSandbox } from "@torkbot/sandbox";
import { image as alpine } from "@torkbot/sandbox-image-alpine-3.23-agent";
const disk = await block.blob.acquire({
provider: {
kind: "s3",
endpoint: "https://<account-id>.r2.cloudflarestorage.com",
bucket: "agent-disks",
region: "auto",
auth: { kind: "environment" },
},
volume: "agent-42-workspace",
sizeBytes: 4n * 1024n * 1024n * 1024n,
});
await using sandbox = await defineSandbox({ rootfs: alpine }).boot({
mounts: { "/workspace": disk },
cwd: "/workspace",
});
await sandbox.exec("sh", ["-lc", "npm install && echo ready > state.txt"]);Guest setup failures now travel over the structured control channel instead of relying on an implicit host-side console file. Boot errors identify the failed mount operation, and a failed boot still closes the device and releases its lease. Sandbox no longer silently creates temporary console directories or pre-creates /workspace in shipped images.