From 3b5d246662a209a5bd21fc89007f8cf9893fbeb5 Mon Sep 17 00:00:00 2001 From: Farhan Helmy <59960562+farhan-helmy@users.noreply.github.com> Date: Mon, 23 Nov 2026 11:42:45 +0800 Subject: [PATCH] fix(cli): restart a running Orca server for a new link (0.14.1) orca-ide pair re-exposes a loopback-bound server to the network and refuses (network_exposure_failed), so resume on a VM that kept running failed. Restart the server with the new link instead; its terminals run in a separate host that outlives it. Includes 0.14.0, never published. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 19 +++++++++++++++++++ package.json | 2 +- src/orca.ts | 10 +++++++--- test/orca.test.ts | 7 +++++++ 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd148dc..6cddc22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,25 @@ This file records user-visible changes to the BoxCompute CLI. GitHub Releases use the same notes and bind them to the exact source commit. +## [0.14.1] - 2026-11-23 + +Waking an Orca workspace whose VM kept running works. + +### CLI users + +- `bxc orca resume` on a VM that is still running (Orca lost contact because + its link changed, not because the VM stopped) failed without a message: + re-pairing a server that listens only on the VM's loopback is refused. It + now restarts Orca's server with the new link; its terminals and agents keep + running. +- Includes 0.14.0, which was never published to npm: `bxc orca` for the + BoxCompute plugin for Orca. +- Update with `bxc update` or `npm install --global @boxcompute/cli@latest`. + +### Security + +- No change to authentication or credential storage. + ## [0.14.0] - 2026-11-23 Orca (orca.dev) can run each workspace on its own BoxCompute VM. diff --git a/package.json b/package.json index edb4c61..84f46ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@boxcompute/cli", - "version": "0.14.0", + "version": "0.14.1", "description": "Connect local AI agents to BoxCompute sandboxes", "keywords": [ "boxcompute", diff --git a/src/orca.ts b/src/orca.ts index 85e48ff..fe5e587 100644 --- a/src/orca.ts +++ b/src/orca.ts @@ -375,9 +375,13 @@ node="$(ls -d "$B"/server/current/runtimes/node-*/bin/node 2>/dev/null | head -n [ -x "$node" ] || node="$(command -v node)" ready() { "$O" status --json 2>/dev/null | "$node" -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{process.exit(JSON.parse(s).result?.runtime?.state==="ready"?0:1)}catch{process.exit(1)}})'; } if ready; then - # Still serving (the VM kept running while its link changed): pair with the new link. - "$O" pair --address "$BXC_ORCA_ADDRESS" --json | "$node" -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{const r=JSON.parse(s).result;if(!r?.pairingUrl)process.exit(1);process.stdout.write(JSON.stringify({schemaVersion:1,pairingCode:r.pairingUrl,projectRoot:process.env.BXC_ORCA_ROOT}))})' > "$out" - exit 0 + # Still serving (the VM kept running while its link changed). orca-ide pair + # would re-expose a loopback-bound server to the network and refuses + # (network_exposure_failed), so restart it with the new link instead. Its + # terminals and agents run in a separate host that outlives the server. + pid="$("$O" status --json 2>/dev/null | "$node" -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{const p=JSON.parse(s).result?.app?.pid;if(Number.isInteger(p))process.stdout.write(String(p))}catch{}})')" + [ -n "$pid" ] && kill "$pid" 2>/dev/null || true + for _ in $(seq 1 40); do ready || break; sleep 0.5; done fi # The launcher prints the result and exits; the server it started keeps running. setsid nohup "$O" serve --port 6768 --bind 127.0.0.1 --project-root "$BXC_ORCA_ROOT" --pairing-address "$BXC_ORCA_ADDRESS" --recipe-json > "$out" 2> "$B/serve.log" < /dev/null & diff --git a/test/orca.test.ts b/test/orca.test.ts index 772baae..8ff34c5 100644 --- a/test/orca.test.ts +++ b/test/orca.test.ts @@ -267,6 +267,13 @@ test("destroy deletes the recorded VM, finds one by name, and is fine with none" expect(await destroy(JSON.stringify({ mode: "destroy", instanceId, recipeResult: { userData: { sandboxId: "sbx_gone" } } }), gone.client)).toBe(0); }); +test("the server listens only on loopback and is restarted, never re-exposed, for a new link", () => { + expect(SERVE_SCRIPT).toContain("--bind 127.0.0.1"); + // orca-ide pair re-exposes a loopback server to the network and refuses. + expect(SERVE_SCRIPT).not.toMatch(/"\$O" pair/); + expect(SETUP_SCRIPT).toContain("sha256sum"); +}); + test("remotes, names and versions", () => { expect(httpsRemote("git@github.com:acme/widget.git")).toBe("https://github.com/acme/widget.git"); expect(httpsRemote("ssh://git@github.com/acme/widget.git")).toBe("https://github.com/acme/widget.git");