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.

Add Modal pty-tunnel logging

+10 -4
+10 -4
apps/api/src/pty/modal/index.ts
··· 36 36 tokenId: options.tokenId, 37 37 tokenSecret: options.tokenSecret, 38 38 }); 39 + consola.info("Modal: fetching sandbox", chalk.greenBright(options.id)); 39 40 const sandbox = await modal.sandboxes.fromId(options.id); 41 + consola.info("Modal: sandbox fetched", chalk.greenBright(options.id)); 40 42 43 + consola.info("Modal: checking pty-tunnel-server", chalk.greenBright(options.id)); 41 44 if (!(await checkIfServerInstalled(sandbox))) { 42 45 await $`bash -c "type /tmp/${SERVER_BIN_NAME} || curl -L ${PTY_SERVER_DOWNLOAD_URL} | tar xz -C /tmp"`; 43 46 ··· 89 92 }, 90 93 ); 91 94 92 - consola.info( 93 - "Sandbox environment set up for sandbox", 94 - chalk.greenBright(options.id), 95 - ); 95 + consola.info("Modal: pty-tunnel-server process started", chalk.greenBright(options.id)); 96 96 97 97 return { sandbox, cmd }; 98 98 } ··· 149 149 consola.error("pty-tunnel-server log stream error:", err), 150 150 ); 151 151 152 + consola.info("Modal: fetching sandbox tunnels", chalk.greenBright(id)); 152 153 const tunnels = await sandbox.tunnels(); 154 + consola.info("Modal: tunnels fetched", JSON.stringify(Object.keys(tunnels))); 153 155 const port = tunnels[PTY_PORT]; 154 156 if (!port) { 155 157 consola.error(`PTY port ${PTY_PORT} not found in sandbox tunnels`, { ··· 159 161 throw new Error(`PTY port ${PTY_PORT} not found in sandbox tunnels`); 160 162 } 161 163 164 + consola.info("Modal: awaiting pty-tunnel connection info", chalk.greenBright(id)); 162 165 const details = await listener.connection; 166 + consola.info("Modal: pty-tunnel connection info received", chalk.greenBright(id)); 163 167 164 168 const url = `wss://${port.url.replace(/^https?:\/\//, "")}` as const; 165 169 consola.info("Connecting to WebSocket URL:", url); ··· 183 187 } 184 188 }); 185 189 190 + consola.info("Modal: waiting for pty-tunnel socket to open", chalk.greenBright(id)); 186 191 await socket.waitForOpen(); 192 + consola.info("Modal: pty-tunnel socket open, sending ready", chalk.greenBright(id)); 187 193 socket.sendMessage({ type: "ready" }); 188 194 189 195 ctx.sessions.set(id, session);