fix(cli): preserve plugin commands in split bundles - #2377
Merged
ymichael merged 1 commit intoAug 25, 2026
Merged
Conversation
ymichael
deleted the
bb/post-merge-fix-preserve-plugin-command-interop-thr_4xkse3sswa
branch
August 25, 2026 03:58
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.
What was wrong
The code-split CLI dynamically imported the CommonJS
undicipackage and requested its namedAgentexport, but esbuild emitted that split chunk with only a default export. Every plugin-contributed command therefore failed while constructing its dispatcher, before the server-side handler ran; ordinary core commands were unaffected.What changed
The plugin proxy now statically imports
Agentinside its already lazy-loaded module and caches the dispatcher synchronously, preserving bundler interop without adding undici to core-command startup. The startup-graph suite now executes both a direct plugin command andbb plugin runfrom a real split artifact against a small HTTP fixture. No CLI contract, documentation, server/daemon wire behavior, orHOST_DAEMON_PROTOCOL_VERSIONchange is required.How you verified
The new split-artifact regression test failed before the production change with
Agent is not a constructorand passes after it.pnpm exec turbo run test --filter=@bb/cli --force— 50 files, 476 tests passedpnpm exec turbo run typecheck --filter=@bb/cli --force— 4 tasks passedpnpm exec turbo run build --filter=bb-app --force— 11 tasks passedautomation --help, explicitplugin run automations --help, and corestatus --jsonsuccessfullyFixes #2349