Skip to content

Commit 7a9e9e9

Browse files
hkiratclaude
andcommitted
fix: use vendi-session template for sandboxes (8 CPU / 8GB RAM)
cpuCount and memoryMB passed to Sandbox.create() were silently ignored by the e2b SDK — these are template-build-time options, not per-sandbox overrides. All sandboxes were starting with the default "base" template (2 CPU / 512 MB). Built a dedicated vendi-session template with the correct resources and reference it by name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 41f913c commit 7a9e9e9

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

apps/server/src/services/sandbox.service.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ export async function startSessionSandbox(
3434
const [ghEncrypted, ghIv] = githubAccount.accessToken.split("|");
3535
const githubToken = decrypt(ghEncrypted, ghIv);
3636

37-
// Create empty sandbox (no per-project template)
38-
const sandbox = await Sandbox.create({
37+
// Create sandbox from the vendi-session template (8 CPU / 8GB RAM)
38+
const sandbox = await Sandbox.create("vendi-session", {
3939
timeoutMs: project.maxSessionDurationMin * 60 * 1000,
40-
cpuCount: 8,
41-
memoryMB: 16384,
4240
envs: {
4341
GITHUB_TOKEN: githubToken,
4442
...(env.OPENAI_API_KEY ? { OPENAI_API_KEY: env.OPENAI_API_KEY } : {}),
4543
...(env.OPENROUTER_API_KEY ? { OPENROUTER_API_KEY: env.OPENROUTER_API_KEY } : {}),
4644
},
47-
} as any);
45+
});
4846

4947
const branchName = `vendi/session-${sessionId}`;
5048

apps/server/src/services/setup.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export async function startSetupSession(projectId: string, userId: string): Prom
362362
(async () => {
363363
try {
364364
await persistState(projectId, { status: "Creating sandbox..." });
365-
const sandbox = await Sandbox.create({ timeoutMs: 30 * 60_000, cpuCount: 8, memoryMB: 16384 } as any);
365+
const sandbox = await Sandbox.create("vendi-session", { timeoutMs: 30 * 60_000 });
366366
sandboxCache.set(projectId, sandbox);
367367
scheduleSandboxCleanup(projectId);
368368
await persistState(projectId, { sandboxId: sandbox.sandboxId });

0 commit comments

Comments
 (0)