background start can launch a different unpatched memorix from ~/node_modules
Description
background start used process.argv[1] as cliEntry. Bun/npm shims can set that to a different install than the CLI the user thinks they ran.
On a Linux host, bun add from $HOME added memorix to ~/package.json. ~/.cache/.bun/bin/memorix background start then spawned:
node /home/<user>/node_modules/memorix/dist/cli/index.js serve-http
That copy was stock 1.6.0 (unpatched), while the global bun install had the large-store fixes. The unpatched binary hydrated 64k observations on the HTTP thread and pegged a core.
Steps to Reproduce
cd $HOME && bun add memorix(or any flow that creates$HOME/node_modules/memorix).- Also have a global
memorixon PATH. cd /path/to/git/project && memorix background startpsthe child: it may be$HOME/node_modules/memorix, not the global package.
Expected Behavior
The daemon is always this package's dist/cli/index.js (the module that is executing background start).
Actual Behavior
A second, often older, tree is spawned. Health/init then regress to the bugs in that tree.
Environment
- Linux, bun global +
$HOME/node_modules/memorix - Memorix 1.6.0
Additional Context
#214 prefers import.meta.url → dist/cli/index.js over argv[1]. Operators should still avoid bun add memorix in $HOME.
Related: #214, background-stdio issue (sibling).
Fix is in PR https://github.com/AVIDS2/memorix/pull/214 — not on main yet, so leaving this issue open until that PR merges.
Relevant work:
13142d320f/35358a1a4c— background start resolves the packaged CLI entry instead of a differentmemorixfrom~/node_modules- Files:
src/cli/commands/background.ts,tests/cli/background-launcher.test.ts
Fixed by #214 and released in v1.6.2. Background mode resolves this package's compiled CLI instead of rediscovering an unrelated Memorix install under the launch directory. Closing as shipped.