Skip to content

Commit 3dbbe4e

Browse files
feat(sandboxes): create non-persistent sandboxes with persistent: false (private beta), never billed for storage
GitOrigin-RevId: b966235eb4e3f115dd2a9c88c337809c41f6007a
1 parent 5246a91 commit 3dbbe4e

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎src/resources/sandboxes/boxes.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,18 @@ export interface BoxCreateParams {
268268

269269
name?: string;
270270

271+
/**
272+
* Persistent (private beta) keeps the sandbox's filesystem across stops (the
273+
* default, true). Set it to false for a disposable sandbox: its writes are
274+
* discarded whenever it stops, the next start boots it fresh from its snapshot,
275+
* and it is never charged for storage. A sandbox that is not persistent cannot
276+
* preserve memory on stop or have its filesystem captured as a snapshot (exporting
277+
* a Docker image from it with docker_image still works), and some snapshots
278+
* captured from other sandboxes cannot start one; such a create is rejected.
279+
* Setting it to false requires the private beta to be enabled for your workspace.
280+
*/
281+
persistent?: boolean;
282+
271283
/**
272284
* PreserveMemoryOnStop, when true, suspends the sandbox's memory on a voluntary
273285
* stop (idle timeout or explicit stop) so the next start resumes from where it

‎src/resources/sandboxes/sandboxes.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,13 @@ export interface SandboxResponse {
11171117

11181118
name?: string;
11191119

1120+
/**
1121+
* Persistent (private beta) reports whether the sandbox keeps its filesystem
1122+
* across stops. When false, its writes are discarded whenever it stops and it is
1123+
* not charged for storage.
1124+
*/
1125+
persistent?: boolean;
1126+
11201127
preserve_memory_on_stop?: boolean;
11211128

11221129
proxy_config?: ProxyConfig;

0 commit comments

Comments
 (0)