Skip to content

Tighten AutoResume docs and trim use-case examples#200

Merged
mishushakov merged 4 commits into
mainfrom
auto-resume-polish
Apr 22, 2026
Merged

Tighten AutoResume docs and trim use-case examples#200
mishushakov merged 4 commits into
mainfrom
auto-resume-polish

Conversation

@beran-t
Copy link
Copy Markdown
Contributor

@beran-t beran-t commented Apr 21, 2026

Summary

  • Rename page title to "Auto resume" and add a description for search/preview.
  • Add a reference to the persistence lifecycle and prose before the pause/read example.
  • Consolidate the three use-case sections into a single web server example and move the cleanup/.kill() note into the main flow.

Rename title to "Auto resume", add a description, and restructure the page around a single web server example. Removes the agent/tool and per-user sandbox use cases.
@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented Apr 21, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
e2b 🟢 Ready View Preview Apr 21, 2026, 2:20 PM

Copy link
Copy Markdown
Member

@mishushakov mishushakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

Comment thread docs/sandbox/auto-resume.mdx Outdated

`AutoResume` handles this automatically: a paused sandbox wakes up when activity arrives, so your code does not have to check or manage sandbox state.
Configure it through the `lifecycle` object when creating a sandbox.
`AutoResume` handles this automatically: a paused sandbox wakes up when activity arrives, so your code doesn't have to check or manage sandbox state. AutoResume builds on the sandbox [persistence](/docs/sandbox/persistence) lifecycle.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no such thing as AutoResume

Comment thread docs/sandbox/auto-resume.mdx Outdated
## Lifecycle options
### Lifecycle options

- `onTimeout` / `on_timeout`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onTimeout (JavaScript) / on_timeout (Python)

Comment thread docs/sandbox/auto-resume.mdx Outdated
---
title: "AutoResume"
sidebarTitle: AutoResume
title: "Auto resume"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be called "Auto-resume on request"

Image

Comment thread docs/sandbox/auto-resume.mdx Outdated
- `onTimeout: "pause"` with `autoResume: false` gives auto-pause without auto-resume.
- `onTimeout: "pause"` with `autoResume: true` gives auto-pause with auto-resume.
- [`Sandbox.connect()`](/docs/sandbox/connect) can still be used to resume a paused sandbox manually.
AutoResume is persistent — if a sandbox resumes and later times out again, it will pause again automatically. To permanently delete a sandbox, call `.kill()`. A killed sandbox cannot be resumed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoResume > Auto-resume

Comment thread docs/sandbox/auto-resume.mdx Outdated
AutoResume is persistent — if a sandbox resumes and later times out again, it will pause again automatically. To permanently delete a sandbox, call `.kill()`. A killed sandbox cannot be resumed.

If you use `autoResume: false`, resume explicitly with [`Sandbox.connect()`](/docs/sandbox/connect).
If `autoResume` is `false`, you can still resume a paused sandbox manually with [`Sandbox.connect()`](/docs/sandbox/connect).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lifecycle.autoResume / lifecycle.auto_resume

Comment on lines -325 to -328
## Cleanup
Auto-resume is persistent, meaning if your sandbox resumes and later times out again, it will pause again.
Each time the sandbox resumes, it gets a fresh timeout (at least 5 minutes, or longer if the original creation timeout exceeds that) — so the sandbox keeps cycling between running and paused as long as activity arrives.
If you call `.kill()`, the sandbox is permanently deleted and cannot be resumed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section was important

Comment thread docs/sandbox/auto-resume.mdx Outdated
## Lifecycle options
### Lifecycle options

- `onTimeout` / `on_timeout`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also do a table like this:

Setting Option Description
onTimeout / on_timeout "kill" (default) Sandbox is terminated when timeout is reached
"pause" Sandbox is paused when timeout is reached
autoResume / auto_resume false (default) Paused sandboxes do not auto-resume
true Paused sandboxes auto-resume on activity. Valid only when onTimeout / on_timeout is set to pause

Comment thread docs/sandbox/auto-resume.mdx Outdated
Comment on lines 45 to 48
@@ -45,14 +47,9 @@ sandbox = Sandbox.create(
- `true`: paused sandboxes auto-resume on activity
- `true` is valid only when `onTimeout`/`on_timeout` is `pause`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • true paused sandboxes auto-resume on activity. Valid only when onTimeout/on_timeout is pause


## Lifecycle options
### Lifecycle options

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention here that it's lifecycle object options

Comment thread docs/sandbox/auto-resume.mdx Outdated
sidebarTitle: AutoResume
title: "Auto resume"
sidebarTitle: Auto resume
description: "Automatically resume paused sandboxes when activity arrives — no manual state management needed."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when activity arrives > on activity

- Retitle to "Auto-resume on request"
- Replace "AutoResume" with "Auto-resume" throughout
- Convert lifecycle options list into a table
- Reframe option names as "onTimeout (JavaScript) / on_timeout (Python)"
- Qualify option references with the `lifecycle.` prefix
- Restore the standalone Cleanup section
@mishushakov mishushakov merged commit 516c346 into main Apr 22, 2026
7 checks passed
@mishushakov mishushakov deleted the auto-resume-polish branch April 22, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants