feat(v1): add E2B runtime provider - #2294
Open
mattteufel-e2b wants to merge 1 commit into
Open
Conversation
mattteufel-e2b
force-pushed
the
feat/e2b-runtime
branch
3 times, most recently
from
August 7, 2026 21:14
f9e8e35 to
496925e
Compare
mattteufel-e2b
commented
Aug 7, 2026
mattteufel-e2b
left a comment
Author
There was a problem hiding this comment.
Add E2B as a runtime provider
Add an e2b remote sandbox runtime alongside prime and modal, implementing the full Runtime contract on the E2B SDK (e2b>=2.35.0): login-shell exec with caller-PATH precedence, durable run_program via file-backed stdout/stderr/status with stream reconnect (rollouts are never replayed), live processes with streamed stdio, background servers exposed through E2B's built-in port proxy, and cancellation-shielded teardown with a sync atexit backstop. Sandboxes boot from a cached E2B template keyed on (image, workdir, cpu, memory), built once behind a cross-process file lock; template resource constraints are validated up front, including task-level resource overrides that bypass pydantic validation. Also drop an explicit 'tools: null' when forwarding chat bodies - some OpenAI-compatible providers reject the explicit null; omission means the same thing. Adds the e2b pytest mark and pairwise e2e placement rows (local-only, excluded in CI like prime/modal), config validation tests, and docs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mattteufel-e2b
force-pushed
the
feat/e2b-runtime
branch
from
August 11, 2026 16:36
496925e to
ae697a2
Compare
mattteufel-e2b
marked this pull request as ready for review
August 11, 2026 16:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an
e2bremote sandbox runtime alongsideprimeandmodal(single squashed commit, rebased on currentmain):verifiers/v1/runtimes/e2b.py— the fullRuntimecontract on the E2B SDK (e2b>=2.35.0): login-shell exec with caller-PATH precedence, durablerun_programwith stream reconnect (rollouts are never replayed), live processes, background servers exposed via E2B's port proxy, and cancellation-shielded teardown with a sync atexit backstop. Sandboxes boot from a cached template keyed on (image, workdir, cpu, memory); resource constraints are validated up front, including task-level overrides.chat.py: drop an explicittools: nullwhen forwarding chat bodies (some OpenAI-compatible providers reject it; omission is equivalent).e2bpytest mark + pairwise e2e placement rows (local-only, like prime/modal), config validation tests, docs.Open question for maintainers: whether to add an
e2boptional extra mirroringverifiers[modal]— left out here to avoid touchingpyproject.tomldeps; the docs prescribeuv add "e2b>=2.35.0"instead.Verification (all against live E2B, inference via Fireworks)
E2BRuntimedirectly — exec/env/cwd/quoting, binary I/O with read caps,run_program, live-process stdio + terminate/kill,run_background+exposereachable from the host,run_uv_script, template cache hit (0.6s second start), idempotent teardown. All passed.SandboxError,network_access=falseblocks egress. All passed.run_programand an 8-min-idleopen_processboth correct; a rollout cancelled mid-program left no sandbox behind (confirmed server-side); 16 concurrent creates all succeeded, paced by thecreates_per_seclimiter. All passed.-m e2bcases green (~48s,-n 4), re-run green after the rebase onto main's limiter + interception-server changes.gsm8k-v1, bash harness in E2B, 6 tasks x 2 rollouts → 12/12 ok, mean reward 1.0, with themath-verifyreward script executing inside each sandbox.🤖 Generated with Claude Code