Let the planning model explore a real clone of the plan's repository
Merged
CH
19d ago+521+521+012345678901234567890123456789-1274-1274-0123456789012345678901234567890123456789
Summary
- During a planning call, the planning model gets a shallow clone of the plan's commit in eve's Vercel Sandbox (
apps/web/eve/sandbox.ts). It explores the clone with one tool,run_in_repository({ command })(apps/web/server/hosted/repository-shell.ts), which runs the command through eve's ownbashtool. - How the clone works: the sandbox's
onSessionhook clones the repo once, when eve creates the sandbox.- The sandbox starts with no network.
- For the clone, network access is opened to
github.comonly, with the account's token added as a header at the firewall, so the token never enters the VM. - Network access is closed again afterwards. Leaving it open would let any command use the token, which is a
repo-scope OAuth token, against GitHub.
- Prompts: the planning prompt and the voice's delegation policy both tell Luke to start exploring the repo as the call starts and to keep talking meanwhile.
- Deleted: the GitHub MCP read (
github-mcp.ts,repository-tools.ts), its tests and golden, the MCP half of the GitHub fake, and@ai-sdk/mcp. - eve's
bashas a new seam: it reaches the host throughBrainHostSeams.bash, passed in fromeve/host.ts. A server function bundle may not import eve at runtime.
PRIVACY.md is a product decision called out here. It adds "How the planning model reads your repository" and a GitHub and Vercel line under "Who we send it to". It says deleting a plan does not yet delete its sandbox copy.
Evidence
- Platform-independent checks:
./scripts/check.shgreen - macOS Electron verification (
./scripts/verify.sh): not run. There is no Mac or UI change. - CI could not verify the live path. Nothing has run against real Vercel Sandbox or GitHub yet. Still to check on a preview deploy:
- git fetch over the firewall-added
Authorizationheader works gitis in eve's base image- eve surfaces a failed
onSessionto the tool call and retries it on the next call - how long the first clone and a later resume take
- git fetch over the firewall-added
Invariants
-
./scripts/check.shgreen. (CI) - JSON Schema goldens:
get-file-contents-tool-input.jsondeleted with the tool it recorded; no other golden moved. - Behavior changes are tested in
tests/repository-shell.test.ts, which runs against a real git repo and real bash:- the clone is at the plan's commit, not HEAD
- later calls reuse the clone
- an account with no GitHub connection is told to connect
- extra arguments are refused
- the token never appears in a result
- Gateway envelope goldens unchanged.
- New
asassertions are in test files only, each with a SAFETY comment. - No new runtime edge.
eve/host.tsis already one, andprepareSandboxruns there. - Test count: the MCP read's tests were removed with it (
repository-tools*.test.ts, onegithub-connectioncase, two host cases), andrepository-shell.test.tsadds 3. - Hand-rolled MCP client deleted.
-
AGENTS.mdnot edited, and it doesn't name these files. -
PRIVACY.mdchanged: product decision, called out above. -
@ai-sdk/mcpdropped fromapps/web/package.json.
Notes
- Follow-ups:
- Delete the sandbox when its plan is deleted.
- Optionally open the sandbox's network after the clone (
"allow-all", with the token rule removed) if Luke needs internet inside it.
- Stacked on #1755.
š¤ Generated with Claude Code