Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
[skip ci] Release new versions
github-actions[bot]6acbeb39ee22
diff --git a/.changeset/python-pyqwest-envd-api.md b/.changeset/python-pyqwest-envd-api.mddeleted file mode 100644index 248feec18..000000000--- a/.changeset/python-pyqwest-envd-api.md+++ /dev/null@@ -1,39 +0,0 @@-----"@e2b/python-sdk": minor------Move the envd HTTP API client (sandbox file transfers, health checks) onto-[`pyqwest`](https://pypi.org/project/pyqwest/) via its httpx-compatible-transport adapter. envd RPC already runs on pyqwest through `connectrpc`, so-all sandbox traffic now shares one HTTP stack built from the same transport-pieces (with separate connection pools per use).--The per-thread (sync) and per-loop (async) envd httpx clients are gone: the-pyqwest transports are thread-safe and loop-independent, so a single client-per module serves all threads and event loops.--Timeout semantics through the adapter:--- Streamed downloads (`files.read(format="stream")`): a `request_timeout`- set explicitly for the call is the deadline for the whole transfer — by- default the transfer is unbounded in total, as before. A stalled stream is- reclaimed by a 60-second idle read timeout that resets on every chunk.- `stream_idle_timeout` keeps working on the async client (applied per- read); the sync client cannot interrupt a blocking read, so it relies on- the transport-wide idle bound and now ignores the parameter.-- Uploads: a buffered upload is bounded by `request_timeout` as a- whole-request deadline, and a streamed (file-like) upload carries no- client-side timeout (a stalled one is bounded server-side by envd's idle- read timeout) — both matching the JS SDK.-- Non-streamed reads (`files.read()` as text or bytes) and buffered uploads- are bounded by `request_timeout` for the **whole transfer** (default- 60 seconds), where the previous transport bounded each socket operation- and left total duration unbounded. Reading or writing a file too large to- transfer inside the deadline now raises `httpx.ReadTimeout` — pass a- larger `request_timeout` (or `0` to disable), or use- `format="stream"`/file-like data, for large transfers.--`E2B_MAX_CONNECTIONS` is no longer read: it configured httpx's global-connection cap, and the last transport that took one is gone (reqwest has no-counterpart — it does not cap concurrent connections). `E2B_KEEPALIVE_EXPIRY`-and `E2B_MAX_KEEPALIVE_CONNECTIONS` keep tuning the pools.diff --git a/.changeset/python-pyqwest-rest-transport.md b/.changeset/python-pyqwest-rest-transport.mddeleted file mode 100644index 70f63adfe..000000000--- a/.changeset/python-pyqwest-rest-transport.md+++ /dev/null@@ -1,56 +0,0 @@-----"@e2b/python-sdk": minor------Move the REST API client (sandbox lifecycle, listing, templates, volumes-control plane) onto [`pyqwest`](https://pypi.org/project/pyqwest/) (Rust-reqwest/hyper) via its httpx-compatible transport adapter, replacing the-httpx-native `HTTPTransport`/`AsyncHTTPTransport`. The generated httpx client-API is unchanged — only the transport underneath is swapped — so logging-event hooks, headers, and redirect handling (`follow_redirects`,-`response.history`) behave as before.--One timeout semantics change: through the adapter, `request_timeout` is a-deadline for the whole API call, where the previous transports applied it to-each phase (connect, read, write) separately — a slow request could exceed it-in total. For the REST API's small JSON exchanges this tightening is what-`request_timeout` reads as promising; `0` still disables it.--Because pyqwest transports are thread-safe and loop-independent (I/O runs on-a Rust runtime), the API connection pool is now shared process-wide per-proxy, instead of one pool per thread (sync) or per event loop (async), and-`ApiClient` no longer maintains per-thread/per-loop httpx client caches — a-single httpx client serves all threads and event loops.-Connection-establishment failures are retried with backoff-(`E2B_CONNECTION_RETRIES`, default 3), matching the connect-only retries of-the previous transports. Timeouts keep raising `httpx.ReadTimeout` (an-`httpx.TimeoutException`), as before, whether they fire while waiting for the-response head or while reading the response body, and connection, network, and-protocol failures keep raising their `httpx` counterparts (`httpx.ConnectError`,-`httpx.ReadError`, `httpx.RemoteProtocolError`).--`proxy` for API calls takes a URL string (e.g.-`proxy="http://user:pass@localhost:8030"`, scheme http, https, socks5, or-socks5h), an `httpx.URL`, or an `httpx.Proxy` — including its credentials-(sent as `Proxy-Authorization`) and any headers configured for the proxy. The-one `httpx.Proxy` option pyqwest cannot express, a per-proxy `ssl_context`,-raises `InvalidArgumentException` rather than being silently dropped.--Low-level HTTP logs stay available: where enabling the `httpcore` logger used-to show connection-level detail, pyqwest logs one line per request on the-`pyqwest.access` logger and request lifecycle records on `pyqwest`, both at-`DEBUG` and off unless enabled:--```python-import logging--logging.basicConfig()-logging.getLogger("pyqwest.access").setLevel(logging.DEBUG)-# DEBUG pyqwest.access - HTTP Request: POST https://api.e2b.app/sandboxes "HTTP/2 201 Created"-```--The SDK's own `logger` option is unchanged and independent of these.--envd traffic is not affected: RPC (commands, PTY, filesystem watch) already-runs on pyqwest via `connectrpc`, and the envd HTTP API (file transfers,-health checks) keeps its httpx transports.diff --git a/.changeset/python-pyqwest-template-uploads.md b/.changeset/python-pyqwest-template-uploads.mddeleted file mode 100644index 27cd6b9a2..000000000--- a/.changeset/python-pyqwest-template-uploads.md+++ /dev/null@@ -1,12 +0,0 @@-----"@e2b/python-sdk": minor------Move template build-context uploads (to S3 presigned URLs) onto-[`pyqwest`](https://pypi.org/project/pyqwest/) via its httpx-compatible-transport adapter. Content-Length framing for the streamed archive body is-preserved (S3 rejects chunked transfer encoding), and redirects stay with the-httpx client instead of being followed inside the transport. The 1-hour upload-timeout now bounds the entire upload rather than each socket operation, and-`verify_ssl=False` on the client is no longer honored for uploads (pyqwest-has no insecure-TLS option).diff --git a/.changeset/python-pyqwest-volume-content.md b/.changeset/python-pyqwest-volume-content.mddeleted file mode 100644index dd48f05a3..000000000--- a/.changeset/python-pyqwest-volume-content.md+++ /dev/null@@ -1,26 +0,0 @@-----"@e2b/python-sdk": minor------Move the volume content client (`Volume`/`AsyncVolume` file operations) onto-[`pyqwest`](https://pypi.org/project/pyqwest/) via its httpx-compatible-transport adapter, the same stack the REST API client uses. The connection-pool is shared process-wide per proxy instead of one pool per thread (sync)-or per event loop (async), and connection-establishment failures are retried-with backoff (`E2B_CONNECTION_RETRIES`, default 3), as before.--For streamed volume reads (`Volume.read_file(format="stream")`), a stalled-stream is by default bounded by a transport-wide idle read timeout of-60 seconds that resets on every chunk (still surfaced as-`httpx.ReadTimeout`; matches the JS SDK's default stream idle timeout).-`AsyncVolume.read_file` keeps honoring an explicit `stream_idle_timeout`-per read (including `0` to disable); the sync client ignores it — it cannot-interrupt a blocking read. Passing `request_timeout` to a streamed read now-bounds the whole transfer rather than individual socket operations.--The same whole-transfer semantics apply to non-streamed operations:-`read_file(format="text"/"bytes")` and uploads are bounded by-`request_timeout` as a total deadline (default 1 hour for file content-operations), where the previous transports bounded each socket operation-and left total duration unbounded. Pass a larger `request_timeout` (or `0`-to disable) for very large transfers on slow links.diff --git a/.changeset/quiet-sandboxes-clean.md b/.changeset/quiet-sandboxes-clean.mddeleted file mode 100644index f92bfb3ea..000000000--- a/.changeset/quiet-sandboxes-clean.md+++ /dev/null@@ -1,6 +0,0 @@-----"e2b": patch-"@e2b/python-sdk": patch------Kill newly created sandboxes when MCP gateway startup fails. The failure now surfaces as `SandboxError` (JS) / `SandboxException` (Python) with a `Failed to start MCP gateway: <stderr>` message instead of a bare command exit error.diff --git a/packages/js-sdk/CHANGELOG.md b/packages/js-sdk/CHANGELOG.mdindex b2a1b19cf..0456382ae 100644--- a/packages/js-sdk/CHANGELOG.md+++ b/packages/js-sdk/CHANGELOG.md@@ -1,5 +1,11 @@# e2b+## 2.38.3++### Patch Changes++- cab27aa: Kill newly created sandboxes when MCP gateway startup fails. The failure now surfaces as `SandboxError` (JS) / `SandboxException` (Python) with a `Failed to start MCP gateway: <stderr>` message instead of a bare command exit error.+## 2.38.2### Patch Changesdiff --git a/packages/js-sdk/package.json b/packages/js-sdk/package.jsonindex 6fe7b9fe1..a51ad0025 100644--- a/packages/js-sdk/package.json+++ b/packages/js-sdk/package.json@@ -1,6 +1,6 @@{"name": "e2b",- "version": "2.38.2",+ "version": "2.38.3","description": "E2B SDK that give agents cloud environments","homepage": "https://e2b.dev","license": "MIT",diff --git a/packages/python-sdk/CHANGELOG.md b/packages/python-sdk/CHANGELOG.mdindex 0a7f335c1..55d9ca4a8 100644--- a/packages/python-sdk/CHANGELOG.md+++ b/packages/python-sdk/CHANGELOG.md@@ -1,5 +1,132 @@# @e2b/python-sdk+## 2.38.0++### Minor Changes++- b048369: Move the envd HTTP API client (sandbox file transfers, health checks) onto+ [`pyqwest`](https://pypi.org/project/pyqwest/) via its httpx-compatible+ transport adapter. envd RPC already runs on pyqwest through `connectrpc`, so+ all sandbox traffic now shares one HTTP stack built from the same transport+ pieces (with separate connection pools per use).++ The per-thread (sync) and per-loop (async) envd httpx clients are gone: the+ pyqwest transports are thread-safe and loop-independent, so a single client+ per module serves all threads and event loops.++ Timeout semantics through the adapter:+ - Streamed downloads (`files.read(format="stream")`): a `request_timeout`+ set explicitly for the call is the deadline for the whole transfer — by+ default the transfer is unbounded in total, as before. A stalled stream is+ reclaimed by a 60-second idle read timeout that resets on every chunk.+ `stream_idle_timeout` keeps working on the async client (applied per+ read); the sync client cannot interrupt a blocking read, so it relies on+ the transport-wide idle bound and now ignores the parameter.+ - Uploads: a buffered upload is bounded by `request_timeout` as a+ whole-request deadline, and a streamed (file-like) upload carries no+ client-side timeout (a stalled one is bounded server-side by envd's idle+ read timeout) — both matching the JS SDK.+ - Non-streamed reads (`files.read()` as text or bytes) and buffered uploads+ are bounded by `request_timeout` for the **whole transfer** (default+ 60 seconds), where the previous transport bounded each socket operation+ and left total duration unbounded. Reading or writing a file too large to+ transfer inside the deadline now raises `httpx.ReadTimeout` — pass a+ larger `request_timeout` (or `0` to disable), or use+ `format="stream"`/file-like data, for large transfers.++ `E2B_MAX_CONNECTIONS` is no longer read: it configured httpx's global+ connection cap, and the last transport that took one is gone (reqwest has no+ counterpart — it does not cap concurrent connections). `E2B_KEEPALIVE_EXPIRY`+ and `E2B_MAX_KEEPALIVE_CONNECTIONS` keep tuning the pools.++- a874ced: Move the REST API client (sandbox lifecycle, listing, templates, volumes+ control plane) onto [`pyqwest`](https://pypi.org/project/pyqwest/) (Rust+ reqwest/hyper) via its httpx-compatible transport adapter, replacing the+ httpx-native `HTTPTransport`/`AsyncHTTPTransport`. The generated httpx client+ API is unchanged — only the transport underneath is swapped — so logging+ event hooks, headers, and redirect handling (`follow_redirects`,+ `response.history`) behave as before.++ One timeout semantics change: through the adapter, `request_timeout` is a+ deadline for the whole API call, where the previous transports applied it to+ each phase (connect, read, write) separately — a slow request could exceed it+ in total. For the REST API's small JSON exchanges this tightening is what+ `request_timeout` reads as promising; `0` still disables it.++ Because pyqwest transports are thread-safe and loop-independent (I/O runs on+ a Rust runtime), the API connection pool is now shared process-wide per+ proxy, instead of one pool per thread (sync) or per event loop (async), and+ `ApiClient` no longer maintains per-thread/per-loop httpx client caches — a+ single httpx client serves all threads and event loops.+ Connection-establishment failures are retried with backoff+ (`E2B_CONNECTION_RETRIES`, default 3), matching the connect-only retries of+ the previous transports. Timeouts keep raising `httpx.ReadTimeout` (an+ `httpx.TimeoutException`), as before, whether they fire while waiting for the+ response head or while reading the response body, and connection, network, and+ protocol failures keep raising their `httpx` counterparts (`httpx.ConnectError`,+ `httpx.ReadError`, `httpx.RemoteProtocolError`).++ `proxy` for API calls takes a URL string (e.g.+ `proxy="http://user:pass@localhost:8030"`, scheme http, https, socks5, or+ socks5h), an `httpx.URL`, or an `httpx.Proxy` — including its credentials+ (sent as `Proxy-Authorization`) and any headers configured for the proxy. The+ one `httpx.Proxy` option pyqwest cannot express, a per-proxy `ssl_context`,+ raises `InvalidArgumentException` rather than being silently dropped.++ Low-level HTTP logs stay available: where enabling the `httpcore` logger used+ to show connection-level detail, pyqwest logs one line per request on the+ `pyqwest.access` logger and request lifecycle records on `pyqwest`, both at+ `DEBUG` and off unless enabled:++ ```python+ import logging++ logging.basicConfig()+ logging.getLogger("pyqwest.access").setLevel(logging.DEBUG)+ # DEBUG pyqwest.access - HTTP Request: POST https://api.e2b.app/sandboxes "HTTP/2 201 Created"+ ```++ The SDK's own `logger` option is unchanged and independent of these.++ envd traffic is not affected: RPC (commands, PTY, filesystem watch) already+ runs on pyqwest via `connectrpc`, and the envd HTTP API (file transfers,+ health checks) keeps its httpx transports.++- b3a7c9f: Move template build-context uploads (to S3 presigned URLs) onto+ [`pyqwest`](https://pypi.org/project/pyqwest/) via its httpx-compatible+ transport adapter. Content-Length framing for the streamed archive body is+ preserved (S3 rejects chunked transfer encoding), and redirects stay with the+ httpx client instead of being followed inside the transport. The 1-hour upload+ timeout now bounds the entire upload rather than each socket operation, and+ `verify_ssl=False` on the client is no longer honored for uploads (pyqwest+ has no insecure-TLS option).+- 458c2c4: Move the volume content client (`Volume`/`AsyncVolume` file operations) onto+ [`pyqwest`](https://pypi.org/project/pyqwest/) via its httpx-compatible+ transport adapter, the same stack the REST API client uses. The connection+ pool is shared process-wide per proxy instead of one pool per thread (sync)+ or per event loop (async), and connection-establishment failures are retried+ with backoff (`E2B_CONNECTION_RETRIES`, default 3), as before.++ For streamed volume reads (`Volume.read_file(format="stream")`), a stalled+ stream is by default bounded by a transport-wide idle read timeout of+ 60 seconds that resets on every chunk (still surfaced as+ `httpx.ReadTimeout`; matches the JS SDK's default stream idle timeout).+ `AsyncVolume.read_file` keeps honoring an explicit `stream_idle_timeout`+ per read (including `0` to disable); the sync client ignores it — it cannot+ interrupt a blocking read. Passing `request_timeout` to a streamed read now+ bounds the whole transfer rather than individual socket operations.++ The same whole-transfer semantics apply to non-streamed operations:+ `read_file(format="text"/"bytes")` and uploads are bounded by+ `request_timeout` as a total deadline (default 1 hour for file content+ operations), where the previous transports bounded each socket operation+ and left total duration unbounded. Pass a larger `request_timeout` (or `0`+ to disable) for very large transfers on slow links.++### Patch Changes++- cab27aa: Kill newly created sandboxes when MCP gateway startup fails. The failure now surfaces as `SandboxError` (JS) / `SandboxException` (Python) with a `Failed to start MCP gateway: <stderr>` message instead of a bare command exit error.+## 2.37.1### Patch Changesdiff --git a/packages/python-sdk/package.json b/packages/python-sdk/package.jsonindex be5d0c4ad..aa6cef73d 100644--- a/packages/python-sdk/package.json+++ b/packages/python-sdk/package.json@@ -1,7 +1,7 @@{"name": "@e2b/python-sdk","private": true,- "version": "2.37.1",+ "version": "2.38.0","scripts": {"example": "uv run python example.py","test": "uv run pytest -n 4 --verbose -x",diff --git a/packages/python-sdk/pyproject.toml b/packages/python-sdk/pyproject.tomlindex 882bb99e1..75905c830 100644--- a/packages/python-sdk/pyproject.toml+++ b/packages/python-sdk/pyproject.toml@@ -1,6 +1,6 @@[project]name = "e2b"-version = "2.37.1"+version = "2.38.0"description = "E2B SDK that give agents cloud environments"authors = [{ name = "e2b", email = "[email protected]" }]license = "MIT"diff --git a/packages/python-sdk/uv.lock b/packages/python-sdk/uv.lockindex c3c2e406a..7029dc8cb 100644--- a/packages/python-sdk/uv.lock+++ b/packages/python-sdk/uv.lock@@ -183,7 +183,7 @@ wheels = [[[package]]name = "e2b"-version = "2.37.1"+version = "2.38.0"source = { editable = "." }dependencies = [{ name = "attrs" },