Secure, Fast, and Extensible Sandbox runtime for AI agents.
Merge pull request #2350 from Claire-ovo/fix/js-response-body-cancellation
ninan-nn9505ddddac76
diff --cc docs/sdks/javascript.mdindex 2e38c6c9e,6aeccea4b..752d8086e--- a/docs/sdks/javascript.md+++ b/docs/sdks/javascript.md@@@ -477,10 -475,9 +477,11 @@@ await sandbox.patchMetadata({ project:The `ConnectionConfig` class manages API server connection settings.+An explicit `OPEN-SANDBOX-API-KEY` in `headers` takes precedence over `apiKey` and its environment fallback, regardless of header-name casing. This also applies to the low-level lifecycle and diagnostic clients.+::: info Runtime Notes- In browsers, the SDK uses the global `fetch` implementation.+ - A caller-provided `AbortSignal` remains active while reading the response body, including SSE streams and download responses. Signal composition uses the standard `AbortSignal.any` API, which must be available in the runtime.- `requestTimeoutSeconds` bounds the wait for a response: it stops applying once the response headers arrive (streaming responses are not cut off). It never caps a healthy file upload body, which can legitimately take longer than the timeout; on Node.js a stalled upload, or an upload that gets no response headers within the timeout once the body has been sent, is aborted instead of hanging (the Go SDK's `ResponseHeaderTimeout` contract).- In Node.js, every `Sandbox` and `SandboxManager` clones the base `ConnectionConfig` via `withTransportIfMissing()`, so each instance gets an isolated `undici` keep-alive pool. Call `sandbox.close()` or `manager.close()` when you are done so the SDK can release the associated agent.:::