You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add workspace / filesystem durability for sandboxes so project files (and related disk state) can survive sandbox sleep, restart, and destroy—not just which provider sandbox id to resume.
This is separate from instance placement durability.
Context / related work
Layer
What it answers
Status
Instance durability (SandboxInstanceStore)
Which provider sandbox to resume for a key across replicas
Instance resume is necessary but not sufficient: even with a stable sandbox id, container local disk is often ephemeral. Apps need an explicit way to persist and restore workspace contents.
Files written only on the container filesystem are typically lost after sleep, eviction, or destroy().
Provider capabilities already surface concepts like snapshots and durableFilesystem, but there is no first-class TanStack AI API for “save workspace” / “restore workspace” that works across providers (or documents Cloudflare-native paths clearly).
Cloudflare Sandbox SDK already offers building blocks (R2 bucket mounts, backup/restore of directories); other providers have snapshots or durable volumes. We need a provider-agnostic product surface (or a clear composition model) so apps don’t invent one-off scripts per vendor.
Goals
Persist workspace state (default /workspace or configured root) across sandbox lifecycle events.
Restore that state on create/resume so the next run continues with the same project files.
Integrate with instance durability when present (e.g. store latestSnapshotId / backup handle on SandboxInstanceRecord or an adjacent artifact store).
Document the two durability layers (instance vs filesystem) so apps wire the right stores.
Prefer provider-native mechanisms where available (snapshots, durable FS, R2 mount, backup/restore), with a clear capability matrix.
Non-goals (for the first cut)
Replacing or merging with chat persistence (@tanstack/ai-persistence transcripts / runs / interrupts).
Auto-persisting the entire container root (system packages, secrets, etc.).
Requiring every provider to implement the same backend (R2-only is fine as a Cloudflare path; others can use snapshots).
Shipping a shared Vitest testkit package redesign (orthogonal to this feature).
Summary
Add workspace / filesystem durability for sandboxes so project files (and related disk state) can survive sandbox sleep, restart, and destroy—not just which provider sandbox id to resume.
This is separate from instance placement durability.
Context / related work
SandboxInstanceStore)RunRecord/ run log)Instance resume is necessary but not sufficient: even with a stable sandbox id, container local disk is often ephemeral. Apps need an explicit way to persist and restore workspace contents.
Problem
Today:
ensure/ resume can reconnect to a provider sandbox when instance records exist (feat(ai-sandbox): SandboxInstanceStore instance durability (BYO) #988).destroy().snapshotsanddurableFilesystem, but there is no first-class TanStack AI API for “save workspace” / “restore workspace” that works across providers (or documents Cloudflare-native paths clearly).Cloudflare Sandbox SDK already offers building blocks (R2 bucket mounts, backup/restore of directories); other providers have snapshots or durable volumes. We need a provider-agnostic product surface (or a clear composition model) so apps don’t invent one-off scripts per vendor.
Goals
/workspaceor configured root) across sandbox lifecycle events.latestSnapshotId/ backup handle onSandboxInstanceRecordor an adjacent artifact store).Non-goals (for the first cut)
@tanstack/ai-persistencetranscripts / runs / interrupts).Design sketch (open for discussion)
Possible shapes (pick / mix during design):
Snapshot API on
SandboxHandle/ providersnapshot()→ idsnapshotIdSandboxInstanceRecord.latestSnapshotIdfrom feat(ai-sandbox): SandboxInstanceStore instance durability (BYO) #988Backup / restore workspace
createBackup/restoreBackupor BYO artifact store)Mount-backed durable paths
/dataor/workspacefor live persistence without explicit snapshotCapability-gated
capabilities().snapshotsordurableFilesystemis true; docs say what to do when neither existsSuggested dependency order:
Implementable after #988 lands; can prototype with in-memory instance store for single-process.
Acceptance criteria
snapshots/durableFilesystem/ limitations).docs/sandbox/durability.md).Open questions
SandboxInstanceRecord, a generation artifact store, or a new small store type?node_modules, etc.)?References
SandboxInstanceStore)