Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
fix(python-sdk): drop envd headers from control-plane connect request (#1402)
Mish Ushakov7296b2c55d5e
diff --git a/.changeset/python-connect-no-envd-headers.md b/.changeset/python-connect-no-envd-headers.mdnew file mode 100644index 000000000..24d8630e4--- /dev/null+++ b/.changeset/python-connect-no-envd-headers.md@@ -0,0 +1,7 @@+---+"@e2b/python-sdk": patch+---++fix(python-sdk): stop sending `E2b-Sandbox-Id`/`E2b-Sandbox-Port` headers on the control-plane `connect` request++`Sandbox.connect` was attaching the envd data-plane headers (`E2b-Sandbox-Id`, `E2b-Sandbox-Port`) to the `POST /sandboxes/{id}/connect` API call. These headers belong only on data-plane (filesystem/commands/pty) requests, matching the JS SDK behavior.diff --git a/packages/python-sdk/e2b/sandbox_async/sandbox_api.py b/packages/python-sdk/e2b/sandbox_async/sandbox_api.pyindex ac1740bfc..7bee5cb07 100644--- a/packages/python-sdk/e2b/sandbox_async/sandbox_api.py+++ b/packages/python-sdk/e2b/sandbox_async/sandbox_api.py@@ -419,13 +419,7 @@ class SandboxApi(SandboxBase):# Sandbox is not running, resume itconfig = ConnectionConfig(**opts)- api_client = get_api_client(- config,- headers={- "E2b-Sandbox-Id": sandbox_id,- "E2b-Sandbox-Port": str(config.envd_port),- },- )+ api_client = get_api_client(config)res = await post_sandboxes_sandbox_id_connect.asyncio_detailed(sandbox_id,client=api_client,diff --git a/packages/python-sdk/e2b/sandbox_sync/sandbox_api.py b/packages/python-sdk/e2b/sandbox_sync/sandbox_api.pyindex 45c5b5561..b45e39cd6 100644--- a/packages/python-sdk/e2b/sandbox_sync/sandbox_api.py+++ b/packages/python-sdk/e2b/sandbox_sync/sandbox_api.py@@ -323,13 +323,7 @@ class SandboxApi(SandboxBase):config = ConnectionConfig(**opts)- api_client = get_api_client(- config,- headers={- "E2b-Sandbox-Id": sandbox_id,- "E2b-Sandbox-Port": str(config.envd_port),- },- )+ api_client = get_api_client(config)res = post_sandboxes_sandbox_id_connect.sync_detailed(sandbox_id,client=api_client,