From a3d65c70e4604d30738c5eeb99b2648907ca06ea Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sun, 8 Feb 2026 11:46:06 +0300 Subject: [PATCH] chore: create sandbox from snapshot and check tools Pass process.env.SNAPSHOT_ID into Sandbox.create as a snapshot source. Replace the installer curl with 'which' checks for openclaw and claude. Re-enable sandbox.stop() and remove the old install log. --- .sandbox/vercel/index.ts | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.sandbox/vercel/index.ts b/.sandbox/vercel/index.ts index 1183dae7..d1731591 100644 --- a/.sandbox/vercel/index.ts +++ b/.sandbox/vercel/index.ts @@ -2,7 +2,17 @@ import { Sandbox } from "@vercel/sandbox"; import consola from "consola"; import chalk from "chalk"; -const sandbox = await Sandbox.create(); +const sandbox = await Sandbox.create( + process.env.SNAPSHOT_ID + ? { + source: { + type: "snapshot", + snapshotId: process.env.SNAPSHOT_ID, + }, + } + : undefined, +); + consola.info( "Vercel Sandbox created with ID:", chalk.greenBright(sandbox.sandboxId), @@ -25,11 +35,16 @@ await sandbox.writeFiles([ consola.info("SSH keys uploaded to sandbox."); -consola.info("Installing openclaw..."); +await sandbox.runCommand({ + cmd: "which", + args: ["openclaw"], + stdout: process.stdout, + stderr: process.stderr, +}); await sandbox.runCommand({ - cmd: "sh", - args: ["-c", "curl -fsSL https://openclaw.ai/install.sh | bash || true"], + cmd: "which", + args: ["claude"], stdout: process.stdout, stderr: process.stderr, }); @@ -88,8 +103,7 @@ await sandbox.runCommand({ }); try { - // await sandbox.snapshot(); - // await sandbox.stop(); + await sandbox.stop(); } catch (e) { consola.error("Error stopping Vercel Sandbox:", e); } -- 2.51.2