Merge pull request #261 from rivet-dev/e2b-autopause-provider

feat: add E2B auto-pause provider lifecycle support
This commit is contained in:
Nathan Flurry 2026-03-16 15:39:45 -07:00 committed by GitHub
commit 9ce71c03c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 416 additions and 13 deletions

View file

@ -39,7 +39,7 @@ try {
}
```
The `e2b` provider handles sandbox creation, Sandbox Agent installation, agent setup, and server startup automatically.
The `e2b` provider handles sandbox creation, Sandbox Agent installation, agent setup, and server startup automatically. Sandboxes pause by default instead of being deleted, and reconnecting with the same `sandboxId` resumes them automatically.
## Faster cold starts

View file

@ -357,10 +357,10 @@ icon: "rocket"
<Step title="Clean up">
```typescript
await client.destroySandbox(); // tears down the sandbox and disconnects
await client.destroySandbox(); // provider-defined cleanup and disconnect
```
Use `client.dispose()` instead to disconnect without destroying the sandbox (for reconnecting later).
Use `client.dispose()` instead to disconnect without changing sandbox state. On E2B, `client.pauseSandbox()` pauses the sandbox and `client.killSandbox()` deletes it permanently.
</Step>
<Step title="Inspect with the UI">

View file

@ -87,7 +87,7 @@ const sdk = await SandboxAgent.start({
// sdk.sandboxId — prefixed provider ID (e.g. "local/127.0.0.1:2468")
await sdk.destroySandbox(); // tears down sandbox + disposes client
await sdk.destroySandbox(); // provider-defined cleanup + disposes client
```
`SandboxAgent.start(...)` requires a `sandbox` provider. Built-in providers:
@ -101,7 +101,7 @@ await sdk.destroySandbox(); // tears down sandbox + disposes client
| `sandbox-agent/vercel` | Vercel Sandbox |
| `sandbox-agent/cloudflare` | Cloudflare Sandbox |
Use `sdk.dispose()` to disconnect without destroying the sandbox, or `sdk.destroySandbox()` to tear down both.
Use `sdk.dispose()` to disconnect without changing sandbox state, `sdk.pauseSandbox()` for graceful suspension when supported, or `sdk.killSandbox()` for permanent deletion.
## Session flow