You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support E2B_SANDBOX_URL env var for Jupyter requests (#310)
* Support E2B_SANDBOX_URL env var and sandbox URL option for Jupyter requests
Resolve the Jupyter server URL through the sandbox URL override
(sandboxUrl/sandbox_url option or E2B_SANDBOX_URL environment variable),
matching the base E2B SDK, and send E2b-Sandbox-Id and E2b-Sandbox-Port
headers on Jupyter requests so a gateway or proxy can route them.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Address review: strip trailing slash from sandbox URL, send X-Access-Token on context requests
Strip trailing slashes when the Jupyter URL comes from the sandbox URL
override so path concatenation can't produce double slashes, and send
X-Access-Token on the context-CRUD requests in the JS SDK and Python
AsyncSandbox, matching run_code and the Python sync Sandbox.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Remove trailing-slash stripping from sandbox URL override
Callers are expected to pass a well-formed sandbox URL, matching the
base SDK, which also returns the override verbatim.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Only send X-Access-Token on execute requests
The Jupyter server only reads X-Access-Token on /execute, where it
forwards the token to envd to fetch the sandbox's global env vars for
the execution. The context endpoints never read it, so drop the header
there — including from the sync Python SDK, which had been sending it
on all requests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Honor the `sandboxUrl`/`sandbox_url` option and the `E2B_SANDBOX_URL` environment variable when connecting to the Jupyter server, matching the base E2B SDK. Jupyter requests now also send the `E2b-Sandbox-Id` and `E2b-Sandbox-Port` headers so a custom sandbox URL (e.g. a gateway or proxy) can route them to the right sandbox and port.
0 commit comments