You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Script automations fork-bomb bb: BB_CLI points at ~/.bb/bin/bb launcher, which hands off to itself in a loop (0.48.0) #6557
automationsBuilt-in plugin: automationsclibb CLIhostHost daemon, process lifecycle, memory, event loopno-reproCould not reproduce as reported (or already fixed); see linked report
On bb 0.48.0 (desktop), any script automation that calls bb starts an endless chain of bb processes. One automation calling bb machine list --all --json once made about 890 nested processes, using about 47 GB RSS, within 2 minutes. It kept growing until I killed it.
Why it happens
Script automations run with BB_CLI set to the shell launcher instead of the CLI binary:
A normal agent thread on the same machine gets BB_CLI=…/bb-app/host-daemon/dist/bb, and that works.
~/.bb/bin/bb runs "$runtime" "$entry" "$@" with entry=…/bb-app/dist/bb.js. bb.js sees that BB_CLI points somewhere other than itself and hands off to it as a child process, not with exec. That child is the launcher again, which starts bb.js again, and so on:
bb (app) → bb-app-bridge.mjs → server/dist/index.js
→ /bin/bash …/automations/scripts/auto_…/wake.sh
→ bb.js machine list --all --json
→ bb.js machine list --all --json
→ bb.js machine list --all --json (… ~890 deep, each the parent of the next)
Reproduce
On bb 0.48.0, create a script automation whose script runs "${BB_CLI:-bb}" machine list --json (any bb subcommand should do it).
Run it, then watch ps -axo pid,ppid,command | grep 'bb.js machine list'. The count grows steadily, and every process is the parent of the next.
Expected
The BB_CLI hand-off should never start itself again. Possible fixes:
Set BB_CLI in the automation environment to the real CLI binary (as threads do), not BB_CLI_LAUNCHER.
Make the hand-off loop-safe: resolve BB_CLI through the launcher, and/or set a guard env var (for example BB_CLI_REEXEC=1) and skip the hand-off when it is already set.
Cap the recursion depth, so a mistake fails with an error instead of exhausting memory.
Workaround
Put unset BB_CLI at the top of automation scripts, or call …/bb-app/host-daemon/dist/bb directly.
Verification: Two clean checkouts of 3bacfac9ed69 each pass a bounded real-launcher check and 69 app-entry tests. Each invocation visits the app entry twice, then returns one version result. The released macOS installation and reported memory usage were not recreated.
No new PR: The bug does not reproduce on trusted main; the root-cause fix merged on October 28, 2026. Existing closed issue state is preserved.
automationsBuilt-in plugin: automationsclibb CLIhostHost daemon, process lifecycle, memory, event loopno-reproCould not reproduce as reported (or already fixed); see linked report
Activity
pascal-de-ladurantaye commentedon Oct 29, 2026
Duplicate of #6435 (fixed on main by #6436, which landed after desktop 0.48.0). I added the 0.48.0 evidence there.
bb-slop-cop commentedon Oct 29, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilothost,cli· Plugin:automations.no-repro.BB_CLI. Main already contains Stop bb-app's CLI entry from re-launching itself through BB_CLI #6436'sBB_CLI_REEXEChandshake, which bypasses that override on re-entry.3bacfac9ed69each pass a bounded real-launcher check and 69 app-entry tests. Each invocation visits the app entry twice, then returns one version result. The released macOS installation and reported memory usage were not recreated.Prepare bb-app 0.48.1 (#6616)