Repository navigation
Description
Summary
On a machine enrolled with the machine install script, ~/.local/bin/bb keeps running the CLI from enrollment time after in-app updates. Any shell that bb did not start (ssh, bash -l, systemd units, cron) gets an old CLI: here 0.46.2 while the app runs 0.50.2. The supported fix, bb settings cli-command install, refuses because of that same shim, so there is no supported way to get a current bb on PATH.
Versions and environment
- bb
0.50.2-nightly.44597192366.1, in-app updates (npm kind), Ubuntu, Node 24. - Enrolled as a machine on 0.46.2 with the install script, then made the full-stack server by a server move (the unit runs
<data dir>/npm/bin/bb-app start). - Tested against
mainat fab8266.
Steps to reproduce
- Enroll a machine with the install script, let it become a full-stack server, and take an in-app update.
- In an ssh shell, run
bb --versionandbb thread regenerate-title --help. - Run
<data dir>/bin/bb --versionandbb settings cli-command show --json.
Expected vs actual
Actual:
$ bb --version
0.46.2-nightly.38916346193.1
$ bb thread regenerate-title --help
error: unknown command 'regenerate-title'
$ <data dir>/bin/bb --version
0.50.2-nightly.44597192366.1
$ bb settings cli-command show --json
{"installedPath": null, "onPath": false, "shadowedBy": {"path": "/home/<user>/.local/bin/bb", "source": "machine"}, "supported": true}
Expected: bb on PATH follows the running bb, or cli-command install can make it do so.
Evidence
- The install script writes the shim once, pointing at
<data dir>/npm/bin/bb: install-machine.sh#L555-L584. - In-app updates install into
<data dir>/app-versions/<version>and never touchnpm/(npm/binhere is dated 18 Oct, itsbb-app/package.jsonis 0.46.2, andbb-app-update.jsoncurrentis 0.50.2). - bb already keeps a current launcher at
<data dir>/bin/bb, rewritten on every full-stack start: launcher.ts#L2046. cli-command installclassifies the shim assource: "machine"and refuses: cli-command.ts#L186-L198, #L274, #L306.- On a bb Connect machine this compounds Agents on a host whose server moved to bb Connect get HTTP 401 from bb: launcher prefers config.json serverUrl over BB_SERVER_URL #4243: when a login profile puts
~/.local/binahead of the daemon's CLI directory (a common installer line,export PATH="$HOME/.local/bin:$PATH"), bb terminals and--run-onscript automations on that machine run this shim. It goes through the packaged launcher, which still prefersconfig.jsonserverUrlover the session'sBB_SERVER_URL(launcher.ts#L1053-L1060), so every plugin command fails withunknown commandafter an HTTP 401.
What you ruled out
- Not Agents on a host whose server moved to bb Connect get HTTP 401 from bb: launcher prefers config.json serverUrl over BB_SERVER_URL #4243: that issue is closed and covered agent threads, whose PATH puts the daemon's CLI first. This is the shim itself going stale, which hits every shell bb did not start.
- Not Provisioning hooks (.bb-env-setup.sh / .bb-env-teardown.sh) cannot reach the bb server after a server move #7192: that is about provisioning hooks that receive no
BB_SERVER_URL. - Still happens on
mainat fab8266 (code paths above unchanged).
Suggested fix
In the machine shim, use $BB_CLI when it is set and executable (the daemon's choice for the session), then <data dir>/bin/bb when present, then npm/bin/bb. Or let cli-command install replace a machine shim whose data dir has a bin/bb launcher. A local patch of the first option fixed both of our machines.
Priority suggestion: affects every enrolled machine that later became a server or took in-app updates. There is a manual workaround (edit the shim), and nothing is lost, but scripts silently run an old CLI.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 20, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotdesktop,cli.confirmed-repro.Run the maintained bb launcher from the machine CLI shim (get-bb#7944)