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 readiness before opening terminal

Add a retry loop (max 10 attempts) with exponential backoff to probe
container readiness ("echo ready") before attaching a terminal; return
503
if still not ready. Also move the Cloudflare sandbox start log to after
the
sandbox has actually started to ensure correct ordering.

+16 -1
+15
apps/cf-sandbox/src/index.ts
··· 616 616 } 617 617 const sandbox = getSandbox(c.env.Sandbox, record.sandboxId); 618 618 await sandbox.start(); 619 + 620 + // Wait for the sandbox container to be ready before connecting terminal 621 + const maxRetries = 10; 622 + for (let i = 0; i < maxRetries; i++) { 623 + try { 624 + await sandbox.exec("echo ready"); 625 + break; 626 + } catch { 627 + if (i === maxRetries - 1) { 628 + return c.text("Sandbox not ready after retries", 503); 629 + } 630 + await new Promise((r) => setTimeout(r, 500 * Math.pow(2, i))); 631 + } 632 + } 633 + 619 634 const sessionId = c.req.query("session"); 620 635 621 636 try {
+1 -1
apps/cf-sandbox/src/providers/cloudflare/index.ts
··· 36 36 } 37 37 38 38 async start(): Promise<void> { 39 - await this.sh`echo "Starting sandbox with ID: ${this.normalizedId}"`; 40 39 await this.sandbox.start(); 40 + await this.sh`echo "Starting sandbox with ID: ${this.normalizedId}"`; 41 41 } 42 42 43 43 async stop(): Promise<void> {