mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 20:03:11 +00:00
Document connect health wait default
This commit is contained in:
parent
ebf450bd99
commit
7d4914c4a2
2 changed files with 5 additions and 0 deletions
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue