Skip to content

fix(sandbox): accept newer E2B SDK transport keywords - #4597

Draft
hemildesai wants to merge 1 commit into
mainfrom
hemild/e2b-transport-kwargs
Draft

hemildesai wants to merge 1 commit into
mainfrom
hemild/e2b-transport-kwargs

Conversation

@hemildesai

@hemildesai hemildesai commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

nemo_gym/sandbox/providers/e2b/_sdk.py replaces the E2B SDK's client_async.get_transport / get_envd_transport with a factory that returns Gym's aiohttp-backed GymAiohttpTransport. Newer E2B SDKs (seen with 2.53.1) call these factories with two more keywords:

  • retry_connect (the envd health probe passes retry_connect=False)
  • http_version

Gym's replacement rejected both. With e2b 2.53.1 installed, every sandbox create failed right after the server returned 201:

_configure_async_http.<locals>.build_transport() got an unexpected keyword argument 'retry_connect'

The fix accepts both keywords and ignores them. Gym's transport is HTTP/1.1-only and does not retry connects, so neither has anything to change. Behaviour with older SDKs is unchanged.

uv.lock resolves e2b 2.46.0, which doesn't pass these keywords, so CI didn't catch this. It only shows up when an environment has a newer e2b within the declared e2b>=2.36.0,<3.0.0 range.

Issue: none filed. This is a small compatibility fix found while running E2B-compatible sandboxes with e2b 2.53.1.

Validation

  • tests/unit_tests/test_e2b_provider.py: the fake-SDK factory test now also calls the patched factory with http_version, for_streaming and retry_connect=False. It fails without the fix (TypeError: ... unexpected keyword argument 'http_version') and passes with it.
  • test_e2b_provider.py, test_e2b_build.py and test_opensandbox_http_transport.py: 171 passed with e2b 2.46.0 (locked) and 171 passed with e2b 2.53.1.
  • With real e2b 2.53.1, sandbox_async.get_envd_api(..., retry_connect=False) and client_async.get_transport(..., http_version="1.1") reproduce the error above without the fix, and return GymAiohttpTransport with it.
  • pre-commit run --all-files: passed.

Rollout evidence

The failure was first seen in a real sandbox probe against an E2B-compatible gateway with e2b 2.53.1: 10/10 creates returned 201, then failed with the error above. I re-ran the same probe with this fix, with no other code changes:

  • create via POST /v2/sandboxes: 10/10 returned 201;
  • connect via POST /v2/sandboxes/{id}/connect: 10/10 returned 200;
  • SDK connect followed by command execution: 10/10;
  • file and network checks across five task images (SWE-bench Python, Java and Rust repos, plus one image without curl): all passed.

An end-to-end eval run on the fix is next.

Compatibility

No config or API changes, and no change for e2b versions that don't pass these keywords.

🤖 Generated with Claude Code

E2B SDK 2.5x passes http_version and retry_connect to the transport
factories Gym replaces with its aiohttp transport (the envd health probe
uses retry_connect=False). The replacement rejected both, so every
sandbox create failed after the server returned 201. Accept and ignore
them: Gym's transport is HTTP/1.1-only and does not retry connects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Hemil Desai <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:sandbox Sandbox providers, isolation, and sandbox runtime contracts bug Something isn't working labels Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:sandbox Sandbox providers, isolation, and sandbox runtime contracts bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants