fix(sandbox): align E2B sandbox with current gitmachine API#61
Open
Nivesh353 wants to merge 1 commit into
Open
fix(sandbox): align E2B sandbox with current gitmachine API#61Nivesh353 wants to merge 1 commit into
Nivesh353 wants to merge 1 commit into
Conversation
sandbox.ts passed `provider: "e2b"` to GitMachine, but current gitmachine expects a pre-built `machine` — so it was undefined and start() crashed. Now construct E2BMachine first and pass it in (+ env/envs key fix, E2B_API_KEY check, fixed /home/user/repo path). Verified end-to-end: --sandbox boots the VM and runs tools inside it.
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.
sandbox.tswas written against an outdated gitmachine API. It passedprovider: "e2b"toGitMachine, but the current gitmachine splits VMcreation (
E2BMachine) from git lifecycle (GitMachine) —GitMachineexpects a ready-built
machineinstance. With none passed,this.machinewas
undefinedandstart()threw. The feature couldn't run at all,regardless of a valid E2B key.
Fix
Construct the
E2BMachinefirst, then hand it toGitMachine(the patterngitmachine's README documents). Four corrections:
E2BMachine({ apiKey, template, timeout, envs })and pass it asmachineGitMachineusesenv(singular);E2BMachineusesenvs(plural)E2B_API_KEYcheck with a helpful errorrepoPathto gitmachine's fixed/home/user/repo; return the builtmachine (was
gitMachine.machine, which is private → undefined)Scope: a single file,
src/sandbox.ts(+22 / −8).Verification
runs commands in isolation).
--sandboxend-to-end — VM boots → repo clones → the agent'sclitool runs inside the sandbox: