From f4a1614a0a4ab4b65e8368d5e4221f015cb7555d Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 8 Jun 2026 21:28:35 +0900 Subject: [PATCH] fix(sandbox): prevent server SIGHUP on sbx exec exit (#792) Replace bare background operator with nohup+disown so the cloudcli server process survives after the sbx exec session terminates. Also redirects stdout/stderr to /tmp/cloudcli-ui.log for debugging via `cloudcli sandbox logs`. Fixes #791 Co-authored-by: NoahHahm Co-authored-by: Claude Sonnet 4.6 Co-authored-by: Haile <118998054+blackmammoth@users.noreply.github.com> --- server/cli.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/cli.js b/server/cli.js index 7551afc4..9fa99ae3 100755 --- a/server/cli.js +++ b/server/cli.js @@ -455,7 +455,7 @@ async function sandboxCommand(args) { await new Promise(resolve => setTimeout(resolve, 5000)); console.log(`${c.info('▶')} Launching CloudCLI web server...`); - sbx(['exec', opts.name, 'bash', '-c', 'cloudcli start --port 3001 &']); + sbx(['exec', opts.name, 'bash', '-c', 'nohup cloudcli start --port 3001 > /tmp/cloudcli-ui.log 2>&1 & disown']); console.log(`${c.info('▶')} Forwarding port ${opts.port} → 3001...`); try { @@ -554,7 +554,7 @@ async function sandboxCommand(args) { // Step 3: Start CloudCLI inside the sandbox console.log(`${c.info('▶')} Launching CloudCLI web server...`); - sbx(['exec', opts.name, 'bash', '-c', 'cloudcli start --port 3001 &']); + sbx(['exec', opts.name, 'bash', '-c', 'nohup cloudcli start --port 3001 > /tmp/cloudcli-ui.log 2>&1 & disown']); // Step 4: Forward port console.log(`${c.info('▶')} Forwarding port ${opts.port} → 3001...`);