From e4075afee5918caa900264c106f5d6a4e4c8feb0 Mon Sep 17 00:00:00 2001 From: 04cb <0x04cb@gmail.com> Date: Sat, 7 Mar 2026 08:35:34 +0800 Subject: [PATCH] Fix missing sandbox.start() call in middleware The sandbox middleware was getting a sandbox instance but never calling sandbox.start() before setting it in the Hono context. This caused containerFetch and wsConnect to fail with 'container is not running' errors. Fixed by adding await sandbox.start() before setting the sandbox in context. The start() method is idempotent and safe to call on every request. --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index 3a615dd61..10d39343b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -136,6 +136,7 @@ app.use('*', async (c, next) => { app.use('*', async (c, next) => { const options = buildSandboxOptions(c.env); const sandbox = getSandbox(c.env.Sandbox, 'moltbot', options); + await sandbox.start(); c.set('sandbox', sandbox); await next(); });