From 36c290bfa0934e3100e50aa6d42dbb0396d769ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kova=C4=BE?= Date: Mon, 7 Sep 2026 08:45:31 +0200 Subject: [PATCH] chore(bb): drop the now-inert BB_APP_NPM_PREFIX from the daemon agent Its only reader in the daemon bundle is the self-update installer: o = process.env.BB_APP_NPM_PREFIX?.trim() ... npm install -g [--prefix o] That path is unreachable without --auto-update, removed in the previous commit, so the variable no longer affects anything the agent runs. Recorded in the comment rather than just deleted, because unset is not a safe default: it omits `--prefix` altogether instead of falling back, so a bare `npm install -g` would install into the mise-managed node. Anyone restoring --auto-update needs this back in the same change, not afterwards. Also fixes the comment above, which pointed at "BB_APP_NPM_PREFIX below" and would have dangled. --- nix/flake.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/nix/flake.nix b/nix/flake.nix index c943976..ce0f777 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -134,10 +134,10 @@ "--host-daemon-port" "38890" # No --auto-update. It is not merely redundant against bbVersion # above, it is broken here in two independent, silent ways: - # * the daemon installs the new build into BB_APP_NPM_PREFIX - # below, but ProgramArguments execs bbClientPrefix — launchd - # never runs the updated tree, and KeepAlive restores the old - # one on the next restart; + # * the daemon installs the new build under its own npm prefix + # while ProgramArguments execs bbClientPrefix — launchd never + # runs the updated tree, and KeepAlive restores the old one on + # the next restart; # * the install shells out to mise's npm wrapper, which ends with # `mise reshim`. launchd's PATH has no /opt/homebrew/bin, so # that exits 127 AFTER npm unpacked the tree correctly; npm @@ -149,7 +149,13 @@ ]; EnvironmentVariables = { BB_DATA_DIR = bbMachineDataDir; - BB_APP_NPM_PREFIX = "${bbMachineDataDir}/npm"; + # No BB_APP_NPM_PREFIX. Its only reader in the daemon bundle is the + # self-update installer, which is unreachable without + # --auto-update, so it was inert config. Worth knowing before + # re-adding the flag: unset omits `--prefix` altogether rather than + # defaulting sensibly, so a bare `npm install -g` would land in the + # mise-managed node install. Restore this alongside any future + # --auto-update, not after it. CLAUDE_CONFIG_DIR = "${homeDirectory}/.config/claude-code"; BB_CLAUDE_CODE_EXECUTABLE = "${homeDirectory}/.local/bin/claude"; };