fetch-index/turndown missing on systemd-daemon (Linux) installs — boot-time node_modules installer only lives in start.mjs, not start-http.mjs

Author: Classico42Created Sep 15, 2026Updated Sep 15, 2026

Version: 1.1.0-rc.3, also reproduces on current main (3 commits ahead of rc.3, none touch this). Linux (CachyOS), Node 22.

Symptom: fetch-index/ctx_fetch_and_index fails on every call with:

Fetch error: Cannot find module 'turndown'
Require stack:
- .../http-server.bundle.mjs

Root cause: http-server.bundle.mjs is built with --external:turndown --external:turndown-plugin-gfm --external:@mixmark-io/domino (resolved from node_modules at runtime). The plugin ships a boot-time background installer for exactly these three packages, but it only exists in start.mjs (~L444-465, the guard is existsSync(node_modules/<pkg>)) — it is not present in start-http.mjs. Any setup that launches the HTTP daemon directly via start-http.mjs (e.g. a systemd user unit running it standalone, for a shared long-lived daemon rather than per-session stdio) never triggers the installer, so node_modules is simply never created and stays missing indefinitely.

This is the same dependency-install gap as #861 (fixed for the Windows/start.mjs path in 1.0.165), but that fix lives entirely in start.mjs's codepath — it doesn't help here because start-http.mjs never calls into that logic at all.

Reproduction:

  1. Run the daemon via a systemd unit (or any launcher) that execs node start-http.mjs directly instead of going through start.mjs.
  2. Fresh plugin install/update — node_modules does not exist in the plugin dir.
  3. Call fetch-index with any URL → Cannot find module 'turndown'.

Workaround (confirmed working):

cd <plugin-dir> && npm install --omit=dev && npm install-scripts approve better-sqlite3 && npm rebuild better-sqlite3

then restart the daemon. Note this does not survive claude plugin update — update re-fetches the plugin dir with no node_modules, so the fix has to be reapplied after every update, silently, with no error surfaced until fetch-index is actually called.

Suggested fix: either move the boot-time install guard into a shared module both start.mjs and start-http.mjs call, or just don't externalize turndown/turndown-plugin-gfm/@mixmark-io/domino in the http-server.bundle.mjs esbuild step and bundle them in directly.