Document connect health wait default

This commit is contained in:
Nathan Flurry 2026-03-05 20:06:05 -08:00
parent ebf450bd99
commit 7d4914c4a2
2 changed files with 5 additions and 0 deletions

View file

@ -188,6 +188,8 @@ icon: "rocket"
token: process.env.SANDBOX_TOKEN,
});
```
`SandboxAgent.connect(...)` waits for `/v1/health` by default. Pass `waitForHealth: false` to disable that behavior, or `waitForHealth: { timeoutMs: 120_000 }` to cap the wait.
</Tab>
<Tab title="curl">

View file

@ -39,6 +39,8 @@ const sdk = await SandboxAgent.connect({
});
```
`SandboxAgent.connect(...)` now waits for `/v1/health` by default before other SDK requests proceed. To disable that gate, pass `waitForHealth: false`. To keep the default gate but fail after a bounded wait, pass `waitForHealth: { timeoutMs: 120_000 }`.
With a custom fetch handler (for example, proxying requests inside Workers):
```ts
@ -170,6 +172,7 @@ Parameters:
- `token` (optional): Bearer token for authenticated servers
- `headers` (optional): Additional request headers
- `fetch` (optional): Custom fetch implementation used by SDK HTTP and ACP calls
- `waitForHealth` (optional, defaults to enabled): waits for `/v1/health` before HTTP helpers and ACP session setup proceed; pass `false` to disable or `{ timeoutMs }` to bound the wait
## Types