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.

Build Hopx template before creating sandbox

Remove "modal-" prefix from template name, build the template with
2 CPUs and 2048MB memory before creating the sandbox, and update the
error message to reflect connect-on-failure behavior

+10 -9
+10 -9
apps/modal-sandbox/src/providers/hopx/index.ts
··· 130 130 const image = options.image || "ghcr.io/pocketenv-io/modal-openclaw:0.1.0"; 131 131 const template = new Template(image); 132 132 const { name } = parseImageRef(image); 133 - const templateName = name.split("/").pop()!; 133 + const templateName = name.split("/").pop()!.replace("modal-", ""); 134 134 135 135 try { 136 + await Template.build(template, { 137 + name: templateName, 138 + apiKey: options.hopxApiKey, 139 + cpu: 2, 140 + memory: 2048, 141 + diskGB: 10, 142 + }); 143 + 136 144 const sandbox = await Sandbox.create({ 137 145 template: templateName, 138 146 apiKey: options.hopxApiKey, ··· 140 148 return new HopxSandbox(sandbox); 141 149 } catch (error) { 142 150 consola.warn( 143 - `Sandbox with template ${templateName} not found, creating a new one...`, 151 + `Template ${templateName} already exists or failed to build, connecting to existing template...`, 144 152 error, 145 153 ); 146 154 ··· 148 156 `echo "This is a custom template built from image ${image}"`, 149 157 ); 150 158 151 - await Template.build(template, { 152 - name: templateName, 153 - apiKey: options.hopxApiKey, 154 - cpu: 2, 155 - memory: 4096, 156 - diskGB: 10, 157 - }); 158 159 const sandbox = await Sandbox.create({ 159 160 template: templateName, 160 161 apiKey: options.hopxApiKey,