Repository navigation
Stop bb-app's CLI entry from re-launching itself through BB_CLI - #6436
Merged
Merged
Conversation
Automation scripts now receive BB_CLI pointing at the public bb launcher, which runs bb-app's entry again. The entry forwarded to BB_CLI with no guard, so each bb call spawned itself until the server ran out of memory. The entry now marks the override child with BB_CLI_REEXEC and runs the bundled CLI when that marker is set, matching the CLI's own guard. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3 tasks done
Merged
ymichael
added a commit
that referenced
this pull request
Oct 30, 2026
## Human comments ## What was wrong desktop 0.48.0 shipped #6194 but not its fix, #6436, which merged two hours after the release. On 0.48.0, any script automation that calls `bb` starts `bb` again without end (#6435, #6557), and users are hitting it: one Discord report had about 3,750 nested `bb thread show` processes on a 48 GB Mac. `bb-app` and `@bb/desktop` are still at 0.48.0, so the publish and desktop workflows can't ship the fix. ## What changed - `packages/bb-app/package.json`, `apps/desktop/package.json`: 0.48.0 → 0.48.1 (`node scripts/bump-version.mjs --patch`). - No release notes for this patch: `CHANGELOG.md` and `changelog-metadata.ts` are unchanged, as with 0.47.1. The release commit sits directly on `a19a8eeffd`, the current `main`, so 0.48.1 ships all 98 commits since 0.48.0. These include two protocol bumps (`HOST_DAEMON_PROTOCOL_VERSION` 256 → 258) and no database migrations. ## How you verified - `node .github/workflows/check-version-lockstep.mjs`: `bb-app=0.48.1 @bb/desktop=0.48.1`. - `git diff --check` is clean. - Reproduced the loop on the published `[email protected]` with `BB_CLI` pointed at a generated launcher: `--version` printed nothing, and 65 processes were running after 3 seconds. The nightly `0.48.1-nightly.40912875657.1`, which contains #6436, is the build that has the fix in the field. > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
#6194 made script automations set
BB_CLIto the public launcher,~/.bb/bin/bb. That launcher runsbb-app/dist/bb.js.runBundledCliCommandrunsBB_CLIwhenever it is set and had no loop guard, so eachbbcall started the launcher again, without end, until the server ran out of memory. See #6435.What changed
runBundledCliCommandmarks theBB_CLIchild withBB_CLI_REEXEC=1. When it sees that mark, it runs the bundled CLI instead. This is the same handshakeapps/cli/src/bb-cli-reexec.tsalready uses.@bb/config/cli-commandfor bb-app. The CLI keeps its own copy because its startup graph must not loadpackages/config(startup-graph.test.ts).How you verified
mainwithexpected 1 to be +0and passes with this change.turbo run typecheck --filter=bb-app --filter=@bb/config --filter=@bb/clipassed.turbo run test --filter=bb-apppassed, 220/220.BB_CLIpointing back at it. It now exits once with the right output and exit code. Before, it grew to 19-33 processes in 3s.Fixes #6435
🤖 Generated with Claude Code