the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wait for sandbox to run before connecting terminal

Poll status up to 30 times (2s interval); error on stopped/error

+11
+11
apps/api/src/pty/hopx/index.ts
··· 39 39 const sandbox = await Sandbox.connect(sandboxId, apiKey); 40 40 consola.info("Hopx: sandbox connected", chalk.greenBright(sandboxId)); 41 41 42 + consola.info("Hopx: waiting for sandbox to be running", chalk.greenBright(sandboxId)); 43 + for (let attempts = 0; attempts < 30; attempts++) { 44 + const info = await sandbox.getInfo(); 45 + if (info.status === "running") break; 46 + if (info.status === "stopped" || info.status === "error") { 47 + throw new Error(`Sandbox is in unexpected state: ${info.status}`); 48 + } 49 + await new Promise((resolve) => setTimeout(resolve, 2000)); 50 + } 51 + consola.info("Hopx: sandbox is running", chalk.greenBright(sandboxId)); 52 + 42 53 consola.info("Hopx: connecting terminal", chalk.greenBright(sandboxId)); 43 54 const ws = await sandbox.terminal.connect(); 44 55 consola.info("Hopx: terminal connected", chalk.greenBright(sandboxId));