Bug Description
Sandbox.connect() (via _cls_connect_sandbox) does not include E2b-Sandbox-Id and E2b-Sandbox-Port headers in the ConnectionConfig. This breaks self-hosted E2B instances where the client proxy uses these headers to route requests to the correct sandbox.
SDK Version
Root Cause
_create correctly adds:
extra_sandbox_headers["E2b-Sandbox-Id"] = sandbox_id
extra_sandbox_headers["E2b-Sandbox-Port"] = str(ConnectionConfig.envd_port)
Error
e2b_connect.client.ConnectException: (invalid_argument, 'Invalid host\n')
Fix
In _cls_connect_sandbox (sync + async), add:
sandbox_headers["E2b-Sandbox-Id"] = sandbox_id
sandbox_headers["E2b-Sandbox-Port"] = str(ConnectionConfig.envd_port)
Bug Description
Sandbox.connect()(via_cls_connect_sandbox) does not includeE2b-Sandbox-IdandE2b-Sandbox-Portheaders in theConnectionConfig. This breaks self-hosted E2B instances where the client proxy uses these headers to route requests to the correct sandbox.SDK Version
2.21.1/ PythonRoot Cause
_createcorrectly adds:Error
e2b_connect.client.ConnectException: (invalid_argument, 'Invalid host\n')Fix
In
_cls_connect_sandbox(sync + async), add: