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
Copy file name to clipboardExpand all lines: docs/sandbox/auto-resume.mdx
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@ title: "AutoResume"
3
3
sidebarTitle: AutoResume
4
4
---
5
5
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.
7
7
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.
9
9
Configure `AutoResume` through the `lifecycle` object when creating a sandbox.
resumeOn:'any',//the sandbox will resume on any traffic
22
22
},
23
23
})
24
24
```
@@ -29,7 +29,7 @@ sandbox = Sandbox.create(
29
29
timeout=10*60,
30
30
lifecycle={
31
31
"on_timeout": "pause",
32
-
"resume_on": "any",
32
+
"resume_on": "any",# the sandbox will resume on any traffic
33
33
},
34
34
)
35
35
```
@@ -42,8 +42,8 @@ sandbox = Sandbox.create(
42
42
-`pause`: sandbox is paused when timeout is reached
43
43
-`resumeOn` / `resume_on`
44
44
-`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`
47
47
48
48
## Behavior summary
49
49
@@ -60,3 +60,8 @@ Configure `lifecycle` with `onTimeout: "pause"` and `resumeOn: "any"` so the san
60
60
61
61
2. Code execution workloads
62
62
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