Skip to content
Source
Sign inSign up
TanStack/ai

feat(ai-sandbox, ai-sandbox-cloudflare): checkpoint at any time, and a provider over an app-owned container #2136

MergedAlemTuzlakmerged 8 commits intomain fromfeat/sandbox-checkpoints-containermerged by AlemTuzlak View on GitHub

Showing 32 changed files with 36 additions and 6 deletions (loading 30).

x
0 of 32 viewed, 32 left
15 additions and 0 deletions.changeset/sandbox-checkpoints-container.mdAdded
View file
@@ -0,0 +1,15 @@
+---
+'@tanstack/ai-sandbox': minor
+'@tanstack/ai-sandbox-cloudflare': minor
+---
+​
+Checkpoint a sandbox workspace at any time, and restore it after a crash.
+​
+- `@tanstack/ai-sandbox`:
+ - New `captureSandboxCheckpoint`, `restoreSandboxCheckpoint` and `sweepSandboxBlobs`. They work on any `SandboxHandle`, also with `sandboxWorkspaceBackend`.
+ - Snapshots now keep file permission bits (for example `+x` scripts) and symlinks. A link that points outside the workspace fails the capture. `exclude` now runs before this check, so an excluded path never fails a capture.
+ - `withSandbox` with portable snapshots now also writes a checkpoint when a run fails or is aborted. This is best effort: a failed capture is logged and the run error stays.
+ - New optional `deleteCheckpoints` on `SandboxCheckpointStore`, implemented by `InMemorySandboxCheckpointStore`, with conformance cases.
+- `@tanstack/ai-sandbox-cloudflare`:
+ - New `@tanstack/ai-sandbox-cloudflare/container` entry with `containerSandbox`. It works over a container that your Durable Object starts (`ctx.container` plus `Files` from `@cloudflare/sandbox` 1.x). It never starts or stops the container and sets no egress. Pass a `DirectoryBackup` to get native snapshots.
+ - `@tanstack/ai-sandbox-local-process` is now an optional peer dependency.
21 additions and 6 deletionsdocs/config.jsonModified
View file
@@ -1413,19 +1413,19 @@
"label": "Portable Snapshots",
"to": "sandbox/portable-snapshots",
"addedAt": "2026-08-14",
- "updatedAt": "2026-10-22"
+ "updatedAt": "2026-11-11"