fix(cli): 1.30.1 — daemon install upgrade-safe + node-pinned
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

two install-path fixes that bit on first 1.30.0 upgrade:

- pin node by absolute path in launchd plist / systemd unit. shebang's
  /usr/bin/env node resolved against the service environment PATH and
  picked up system Node 22.x, which lacks node:sqlite (experimental)
  → daemon died with ERR_UNKNOWN_BUILTIN_MODULE. process.execPath now
  goes first, so the daemon always runs under the same Node that ran
  claudemesh install.
- tear down the old daemon before bootstrapping. claudemesh install on
  a machine with an already-running daemon hit Bootstrap failed: 5:
  Input/output error (launchctl refuses to re-bootstrap a loaded unit
  + old daemon held the singleton lock). Now we run launchctl bootout
  (systemd: systemctl --user stop) first, plus SIGTERM to any orphan
  pid in daemon.pid, so subsequent installs replace cleanly.

both fixes apply to darwin and linux paths. windows path is unchanged
— it doesn't have a service-install today (daemon-install-service
errors with "unsupported platform" on win32).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-05-04 13:31:27 +01:00
parent 0b3014e7eb
commit 052f65149d
3 changed files with 72 additions and 3 deletions

View File

@@ -1,5 +1,28 @@
# Changelog
## 1.30.1 (2026-05-04) — daemon install upgrade-safe + node-pinned
Two install-path fixes that bit on first user upgrade:
- **Pin `node` by absolute path in the launchd plist / systemd unit.**
The bin script's `#!/usr/bin/env node` shebang resolves against the
service environment's PATH, which on macOS launchd defaults to
`/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin`.
That picks up whatever Node is installed system-wide instead of the
Node that ran `claudemesh install` — and Node 22.x doesn't expose
`node:sqlite` without the experimental flag, so the daemon crashed
with `db open failed: ERR_UNKNOWN_BUILTIN_MODULE`. Now we write
`process.execPath` as the first ProgramArgument so the daemon
always runs under the same Node that installed it.
- **Tear down the old daemon before re-bootstrapping.** `claudemesh
install` on a machine that already has a running daemon was hitting
`Bootstrap failed: 5: Input/output error` because launchctl refuses
to bootstrap a unit that's already loaded, and the old daemon
process held the singleton lock. The install path now runs
`launchctl bootout` (or `systemctl --user stop`) first, plus a
`SIGTERM` to any orphaned daemon pid in `~/.claudemesh/daemon/
daemon.pid`, so subsequent installs replace cleanly.
## 1.30.0 (2026-05-04) — per-session broker presence
Sprint A Phase 3. Two `claudemesh launch` sessions in the same cwd now