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
{{ message }}
Repository navigation
ai-sandbox-cloudflare: upgrade @cloudflare/sandbox to 1.x for container snapshots #1983
Upgrade @cloudflare/sandbox from ^0.12.1 to 1.x in @tanstack/ai-sandbox-cloudflare and in examples/sandbox-cloudflare. Cloudflare now documents 0.x only "for existing applications".
Why
Sandbox SDK 1.0 lets your own Durable Object control each container through ctx.container, with the durable_object scheduling policy. That unlocks features that our provider cannot use today:
Container snapshots.ctx.container.snapshotContainer() saves the whole container disk. ctx.container.start({ containerSnapshot }) restores it. Snapshots live 30 days, and each restore renews them. With this, the provider can set snapshots: true and implement handle.snapshot() and restoreSnapshot(). Today it declares snapshots: false and durableFilesystem: false.
Directory backups without R2 keys. In 1.0, DirectoryBackup sends backups through a DirectoryBackupGateway in the Worker. The container gets no R2 credentials. In 0.12, createBackup() needs R2 API keys as Worker secrets.
Instance size per container.start({ instance }) picks the size at runtime. In 0.12, one instance_type applies to the whole app.
Activity