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.

Remove sandbox start retries and readiness waits

Rely on the sandbox provider/internal start logic for startup and
readiness. Remove manual exponential-backoff loops that blocked DB
updates and terminal connections.

-26
-26
apps/cf-sandbox/src/index.ts
··· 303 303 return c.json({ error: "Sandbox provider not supported" }, 400); 304 304 } 305 305 306 - for (let i = 0; i < 10; i++) { 307 - try { 308 - console.log(`Attempting to start sandbox (try ${i + 1}/10)`); 309 - await sandbox.start(); 310 - await sandbox.sh`echo ready`; 311 - break; 312 - } catch { 313 - if (i === 9) return c.json({ error: "Sandbox failed to start" }, 503); 314 - await new Promise((r) => setTimeout(r, 500 * Math.pow(2, i))); 315 - } 316 - } 317 - 318 306 await c.var.db 319 307 .update(sandboxes) 320 308 .set({ ··· 627 615 } 628 616 const sandbox = getSandbox(c.env.Sandbox, record.sandboxId); 629 617 await sandbox.start(); 630 - 631 - // Wait for the sandbox container to be ready before connecting terminal 632 - const maxRetries = 10; 633 - for (let i = 0; i < maxRetries; i++) { 634 - try { 635 - await sandbox.exec("echo ready"); 636 - break; 637 - } catch { 638 - if (i === maxRetries - 1) { 639 - return c.text("Sandbox not ready after retries", 503); 640 - } 641 - await new Promise((r) => setTimeout(r, 500 * Math.pow(2, i))); 642 - } 643 - } 644 618 645 619 const sessionId = c.req.query("session"); 646 620