e2b@2.30.5
Patch Changes
-
60feee3: Stream uploads instead of buffering streaming input entirely in memory:
Sandbox.files.write()/write_files():ReadableStreamdata (JS, outside the browser) and file-like objects (Python) are streamed to the sandbox, including whengzipis enabled (compression now happens chunk by chunk).useOctetStream/use_octet_streamnow defaults to auto-detect — octet-stream is used when any entry is streamable (so streamed uploads aren't silently buffered) andmultipart/form-dataotherwise; browsers always usemultipart/form-data. A streamed upload is bounded by a per-chunk timeout on the wire (Python's per-writehttpxtimeout, default the request timeout); a stalled upload that this can't observe is bounded server-side. On Python'sAsyncSandbox, the blocking file reads and gzip compression of a streamed upload now run in a worker thread so a large upload doesn't stall the event loop.Sandbox.files.read(format="stream"): the request timeout now bounds only the initial handshake instead of killing the stream while it's being consumed. The body is bounded by a per-chunk idle timeout on the wire (streamIdleTimeoutMsin JS,stream_idle_timeoutin Python, default the request timeout — 60s —0/Noneto disable): it aborts only when the server stops sending mid-stream, and a slow or paused consumer never trips it (a held-but-unread stream is reclaimed server-side). Usesignal(JS) to cancel an in-flight stream. A dropped connection during the stream handshake now surfaces the same typed, health-checked error as non-stream reads. The stream holds a pooled connection until it is consumed to the end, cancelled/closed, errors, or the idle timeout fires — consume it fully, use the context manager, or close it.- Python
Sandbox.files.read(format="stream"): the response body is now streamed from the sandbox instead of being downloaded into memory before iteration (sync and async). - JS
Sandbox.files.read()withbloborstreamformat now returns an emptyBlob/ReadableStreamfor empty files instead of"".
-
c1415f3: Stream volume file uploads and downloads instead of buffering in memory:
Volume.writeFile()/Volume.write_file():ReadableStreamdata (JS, outside the browser) and file-like objects (Python) are now streamed to the API in chunks.Volume.readFile(format="stream")/read_file(format="stream"): the request timeout now bounds only the initial handshake instead of killing the stream while it's being consumed (Python disables the read timeout; JS bounds the handshake and supportssignalto cancel an in-flight stream). A dropped connection during the stream handshake now surfaces the same typed, health-checked error as non-stream reads.