Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api-reference/checkpoints/fork.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Create a new sandbox from a checkpoint.
</ParamField>

<ParamField body="timeout" type="integer">
Idle timeout for the new sandbox (default: `300`)
Idle timeout for the new sandbox (default: `0` — persistent, never auto-hibernates)
</ParamField>

<ParamField body="envs" type="object">
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/sandboxes/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Create a new sandbox.
</ParamField>

<ParamField body="timeout" type="integer">
Idle timeout in seconds (default: `300`)
Idle timeout in seconds (default: `0` — persistent, never auto-hibernates)
</ParamField>

<ParamField body="cpuCount" type="integer">
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/sandboxes/wake.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resume a hibernated sandbox. Control plane only.
</ParamField>

<ParamField body="timeout" type="integer">
Idle timeout after wake (default: `300`)
Idle timeout after wake (default: `0` — persistent, never auto-hibernates)
</ParamField>

<ResponseExample>
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/sandbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The sandbox keeps the same ID across hibernate/wake cycles. Preview URLs remain

## Adjusting Timeout

The idle timeout resets on every operation (exec, file access, agent activity). Default: 300s.
The idle timeout resets on every operation (exec, file access, agent activity). Default: `0` — persistent, never auto-hibernates. Set a positive value (or `0` to disable) with `oc sandbox set-timeout`.

```bash
oc sandbox set-timeout sb-abc123 3600 # 1 hour
Expand Down
2 changes: 1 addition & 1 deletion docs/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Why not containers? Containers share a kernel. A kernel exploit in one container

`hibernate()` snapshots the VM's memory and disk state, then stops it. No compute costs while hibernated. `wake()` restores the sandbox — the platform attempts a fast snapshot-based resume and falls back to a cold boot from the saved disk state if needed.

The sandbox keeps the same ID across hibernate/wake cycles. A rolling idle timeout (default 300s) auto-hibernates sandboxes that go unused.
The sandbox keeps the same ID across hibernate/wake cycles. By default sandboxes are persistent and never auto-hibernate; set a positive `timeout` and a rolling idle timer auto-hibernates the sandbox once it goes unused for that long.

## Checkpoints & Forking

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Create a new sandbox. **Alias:** `oc create`

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--timeout` | int | `300` | Idle timeout in seconds |
| `--timeout` | int | `0` | Idle timeout in seconds |
| `--cpu` | int | `0` | CPU cores (0 = platform default) |
| `--memory` | int | `0` | Memory in MB (0 = platform default) |
| `--env` | string | — | Environment variable `KEY=VALUE` (repeatable) |
Expand Down Expand Up @@ -66,7 +66,7 @@ Resume a hibernated sandbox.

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--timeout` | int | `300` | Idle timeout in seconds after wake |
| `--timeout` | int | `0` | Idle timeout in seconds after wake |

### `oc sandbox set-timeout <id> <seconds>`

Expand Down Expand Up @@ -175,7 +175,7 @@ Create a new sandbox from a checkpoint (fork).

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--timeout` | int | `300` | Idle timeout for the new sandbox |
| `--timeout` | int | `0` | Idle timeout for the new sandbox |

```bash
ID=$(oc cp spawn cp-xyz --json | jq -r '.sandboxID')
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cli/checkpoint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Revert a sandbox in-place to a checkpoint. All changes since the checkpoint are

Create a new sandbox from a checkpoint (fork). [HTTP API →](/api-reference/checkpoints/fork)

<ParamField query="--timeout" type="int" default="300">
<ParamField query="--timeout" type="int" default="0">
Idle timeout for the new sandbox
</ParamField>

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/cli/sandbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Create a new sandbox. **Alias:** `oc create`

[HTTP API →](/api-reference/sandboxes/create)

<ParamField query="--timeout" type="int" default="300">
Idle timeout in seconds
<ParamField query="--timeout" type="int" default="0">
Idle timeout in seconds. `0` (the default) means never auto-hibernate.
</ParamField>

<ParamField query="--cpu" type="int" default="0">
Expand Down Expand Up @@ -84,7 +84,7 @@ Snapshot VM state and stop the sandbox. Displays snapshot size on success. [HTTP

Resume a hibernated sandbox. [HTTP API →](/api-reference/sandboxes/wake)

<ParamField query="--timeout" type="int" default="300">
<ParamField query="--timeout" type="int" default="0">
Idle timeout in seconds after wake
</ParamField>

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/python-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Create a new sandbox.
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `template` | str | `"base"` | Template name |
| `timeout` | int | `300` | Idle timeout in seconds |
| `timeout` | int | `0` | Idle timeout in seconds |
| `api_key` | str | env var | API key |
| `api_url` | str | env var | API URL |
| `envs` | dict[str, str] | None | Environment variables |
Expand Down Expand Up @@ -60,7 +60,7 @@ sandbox = await Sandbox.connect("sb-abc123")
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `checkpoint_id` | str | — | Checkpoint ID (**required**) |
| `timeout` | int | `300` | Idle timeout |
| `timeout` | int | `0` | Idle timeout |
| `api_key` | str | env var | API key |
| `api_url` | str | env var | API URL |

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/python-sdk/sandbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Create a new sandbox. [HTTP API →](/api-reference/sandboxes/create)
Template name
</ParamField>

<ParamField body="timeout" type="int" default="300">
Idle timeout in seconds
<ParamField body="timeout" type="int" default="0">
Idle timeout in seconds. `0` (the default) means persistent — the sandbox never auto-hibernates.
</ParamField>

<ParamField body="api_key" type="str">
Expand Down Expand Up @@ -96,7 +96,7 @@ Create a new sandbox from a checkpoint. [HTTP API →](/api-reference/checkpoint
Checkpoint ID
</ParamField>

<ParamField body="timeout" type="int" default="300">
<ParamField body="timeout" type="int" default="0">
Idle timeout
</ParamField>

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/typescript-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Create a new sandbox.
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `template` | string | `"base"` | Template name |
| `timeout` | number | `300` | Idle timeout in seconds |
| `timeout` | number | `0` | Idle timeout in seconds |
| `apiKey` | string | env var | API key |
| `apiUrl` | string | env var | API URL |
| `envs` | Record\<string, string\> | — | Environment variables |
Expand Down Expand Up @@ -64,7 +64,7 @@ Create a new sandbox from a checkpoint.
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `checkpointId` | string | — | Checkpoint ID (**required**) |
| `timeout` | number | `300` | Idle timeout |
| `timeout` | number | `0` | Idle timeout |
| `apiKey` | string | env var | API key |
| `apiUrl` | string | env var | API URL |

Expand Down Expand Up @@ -120,7 +120,7 @@ Resume a hibernated sandbox.

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `timeout` | number | `300` | Idle timeout after wake |
| `timeout` | number | `0` | Idle timeout after wake |

#### `sandbox.setTimeout(timeout): Promise<void>`

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/typescript-sdk/sandbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Create a new sandbox. [HTTP API →](/api-reference/sandboxes/create)
Template name
</ParamField>

<ParamField body="timeout" type="number" default="300">
Idle timeout in seconds
<ParamField body="timeout" type="number" default="0">
Idle timeout in seconds. `0` (the default) means persistent — the sandbox never auto-hibernates.
</ParamField>

<ParamField body="apiKey" type="string">
Expand Down Expand Up @@ -116,7 +116,7 @@ Create a new sandbox from a checkpoint. [HTTP API →](/api-reference/checkpoint
Checkpoint ID
</ParamField>

<ParamField body="timeout" type="number" default="300">
<ParamField body="timeout" type="number" default="0">
Idle timeout
</ParamField>

Expand Down Expand Up @@ -192,7 +192,7 @@ Snapshot VM state and stop. No compute cost while hibernated. [HTTP API →](/ap

Resume a hibernated sandbox. [HTTP API →](/api-reference/sandboxes/wake)

<ParamField body="timeout" type="number" default="300">
<ParamField body="timeout" type="number" default="0">
Idle timeout after wake
</ParamField>

Expand Down
4 changes: 2 additions & 2 deletions docs/sandboxes/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ curl -X POST https://app.opencomputer.dev/api/sandboxes \
| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `template` | string | `"base"` | Template for the VM root filesystem |
| `timeout` | number | `300` | Idle timeout in seconds (resets on every operation) |
| `timeout` | number | `0` | Idle timeout in seconds, resets on every operation. `0` (default) = persistent, never auto-hibernates |
| `envs` | object | — | Environment variables set inside the VM |
| `metadata` | object | — | Arbitrary key-value pairs stored with the sandbox |
| `cpuCount` | number | — | CPU cores. TypeScript and HTTP API only |
Expand Down Expand Up @@ -125,7 +125,7 @@ Sandboxes have four states:
| `stopped` | Terminated |
| `error` | Failed |

A rolling idle timeout (default 300s) resets on every operation — exec, file access, agent activity. When the timeout expires, the sandbox auto-hibernates if possible, otherwise stops.
By default a sandbox is persistent (`timeout` `0`) and never auto-hibernates. When you set a positive `timeout`, a rolling idle timer resets on every operation — exec, file access, agent activity. When the timer expires, the sandbox auto-hibernates if possible, otherwise stops.

## Hibernation & Wake

Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The sandbox is still starting up, or it's hibernated and hasn't finished waking.

**Command timeout:** Increase the `timeout` parameter on `exec.run()` or use `--timeout` with `oc exec`. Default is 60s for SDK `exec.run()`, unlimited for CLI without `--wait`.

**Idle timeout:** Sandboxes auto-hibernate after 300s of inactivity. Increase with `sandbox.setTimeout()` or `oc sandbox set-timeout`. The timeout resets on every operation.
**Idle timeout:** By default sandboxes are persistent (`timeout` `0`) and do not auto-hibernate. If you created the sandbox with a positive `timeout`, it auto-hibernates after that many seconds of inactivity. Adjust with `sandbox.setTimeout()` or `oc sandbox set-timeout` (`0` disables auto-hibernate). The timeout resets on every operation.

### Agent exits immediately

Expand Down