Skip to content

Commit b3d3616

Browse files
update intro
1 parent dc25731 commit b3d3616

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

docs/sandbox/auto-resume.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: "AutoResume"
33
sidebarTitle: AutoResume
44
---
55

6-
Managing sandbox lifecycle manually can get painful. Instead of handling pause/resume orchestration yourself, your sandbox should come back to life when you need it.
6+
You shouldn't have to manually manage sandbox pause/resume. With AutoResume, your sandbox can pause at timeout and come back when traffic arrives, so it's available when needed without extra orchestration.
77

8-
`AutoResume` builds on [sandbox persistence](/docs/sandbox/persistence): a sandbox pauses at timeout and then resumes from that paused state when it receives traffic.
8+
`AutoResume` builds on [sandbox persistence](/docs/sandbox/persistence): a sandbox pauses at timeout and resumes from that paused state when it receives traffic.
99
Configure `AutoResume` through the `lifecycle` object when creating a sandbox.
1010

1111
## Configure lifecycle on create
@@ -18,7 +18,7 @@ const sandbox = await Sandbox.create({
1818
timeoutMs: 10 * 60 * 1000,
1919
lifecycle: {
2020
onTimeout: 'pause',
21-
resumeOn: 'any',
21+
resumeOn: 'any', //the sandbox will resume on any traffic
2222
},
2323
})
2424
```
@@ -29,7 +29,7 @@ sandbox = Sandbox.create(
2929
timeout=10 * 60,
3030
lifecycle={
3131
"on_timeout": "pause",
32-
"resume_on": "any",
32+
"resume_on": "any", # the sandbox will resume on any traffic
3333
},
3434
)
3535
```
@@ -42,8 +42,8 @@ sandbox = Sandbox.create(
4242
- `pause`: sandbox is paused when timeout is reached
4343
- `resumeOn` / `resume_on`
4444
- `off` (default): paused sandboxes do not auto-resume
45-
- `any`: paused sandboxes auto-resume on activity
46-
- `any` is valid only when `onTimeout`/`on_timeout` is `pause`
45+
- `any`: paused sandboxes auto-resume on activity.
46+
- `any` is valid only when `onTimeout`/`on_timeout` is `pause`
4747

4848
## Behavior summary
4949

@@ -60,3 +60,8 @@ Configure `lifecycle` with `onTimeout: "pause"` and `resumeOn: "any"` so the san
6060

6161
2. Code execution workloads
6262
For agent/tool execution, use `resumeOn: "any"` so the sandbox can start back up automatically when the next command or code execution request arrives.
63+
64+
## Cleanup
65+
Auto-resume is persistent, meaning if your sandbox resumes and later times out again, it will pause again.
66+
67+
If you call `.kill()`, the sandbox is permanently deleted and cannot be resumed.

0 commit comments

Comments
 (0)