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
+40-6Lines changed: 40 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,14 +55,48 @@ If you use `resumeOn: "off"`, resume explicitly with [`Sandbox.connect()`](/docs
55
55
56
56
## Use cases
57
57
58
-
1. Running a web server
59
-
Configure `lifecycle` with `onTimeout: "pause"` and `resumeOn: "any"` so the sandbox can resume when traffic hits your service again. Useful if you:
58
+
### Running a web server
60
59
61
-
- Have a webpage you only want to check periodically
62
-
- Have an API you want to expose for testing or other purposes
60
+
Use `onTimeout: "pause"` + `resumeOn: "any"` so traffic can wake a paused sandbox automatically.
63
61
64
-
2. Code execution workloads
65
-
For agent/tool execution, use `resumeOn: "any"` so the sandbox can start back up automatically when the next command or code execution request arrives.
The same lifecycle configuration works for agent and tool workloads: after timeout, the sandbox pauses, and the next execution request can wake it automatically.
66
100
67
101
## Cleanup
68
102
Auto-resume is persistent, meaning if your sandbox resumes and later times out again, it will pause again.
0 commit comments