Skip to content

e2b@2.62.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 20:24
· 2 commits to main since this release

Minor Changes

  • 9fdfa21: Add retainOutput (JS) / retain_output (Python) option to commands.run and commands.connect (default true)

    • When false, stdout/stderr are not buffered in memory; stdout/stderr on the handle, result and CommandExitError/CommandExitException are undefined/None
    • Output callbacks (onStdout/onStderr, on_stdout/on_stderr) still receive all output
  • d58ef55: files.write streams iterables of byte chunks to the sandbox instead of buffering them:

    • JS: AsyncIterable<Uint8Array> data (async generators, Node.js Readable), alongside ReadableStream.
    • Python: Iterable[bytes] in Sandbox and AsyncIterable[bytes] in AsyncSandbox; each SDK rejects the other's iterable kind with InvalidArgumentException.

    Stream data always uses the octet-stream upload, works with gzip, and is never buffered in memory. In browsers that can't stream a request body (Firefox, Safari and every iOS browser), JS stream data throws InvalidArgumentError instead (pass a Blob, e.g. await new Response(stream).blob()); Chromium-based browsers stream it. A chunk that isn't bytes throws InvalidArgumentError / InvalidArgumentException rather than a transport error.

    Python file-like objects that aren't io.IOBase but have a sync read() (tempfile.NamedTemporaryFile(), werkzeug FileStorage, Django File) are uploaded as files; objects with an async read() (aiofiles, aiohttp response.content) are consumed as async iterables by AsyncSandbox. WriteEntry (str, bytes or file-like data) is accepted by both Sandbox.files.write_files and AsyncSandbox.files.write_files; the new SyncWriteEntry and AsyncWriteEntry additionally take Iterable[bytes] / AsyncIterable[bytes].

    Breaking (JS): ReadableStream / AsyncIterable data is no longer buffered: browsers without streaming request bodies throw, and multipart is refused — useOctetStream: false throws InvalidArgumentError, and an envd older than 0.5.7 throws TemplateError. Python raises InvalidArgumentException / TemplateException for iterables in the same cases.

    Breaking (both SDKs): gzip: true with useOctetStream: false / gzip=True, use_octet_stream=False is now rejected as an invalid combination (InvalidArgumentError / InvalidArgumentException) instead of gzip silently overriding it.