Repository navigation
Give bb's own registrations one owner id and drop their private-state imports - #7893
Merged
ymichael merged 1 commit intoNov 20, 2026
Conversation
… imports
Core stamped its plugin-shaped registrations with two owner ids, "core" and
"bb--core". CORE_PLUGIN_ID ("bb--core") now lives in @bb/domain and one
helper, collectCoreContributionSlots, stamps it, so the thread-action
registry maps core and plugin entries the same way. Info tabs saved as
plugin-fixed:core:info convert on read.
Thread actions and the parent-thread segment now read the same hooks the
SDK hands plugins (useBbContext, useSidebarSplitLayout, useThreadContextKind,
copyToClipboard) instead of jotai atoms, route state, a zod schema and a
private clipboard helper.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/core-contributions-boundary-prototype-candidates-thr_sd3apyw3f9
branch
from
November 20, 2026 19:56
1a3a291 to
4041e04
Compare
ymichael
deleted the
bb/core-contributions-boundary-prototype-candidates-thr_sd3apyw3f9
branch
November 20, 2026 22:01
ymichael
added a commit
that referenced
this pull request
Nov 21, 2026
## Human comments ## What was wrong Two tests added in #7911, "fetches only the resolved commit instead of the whole repository" and "falls back to a full clone when the server refuses to serve the commit directly", sit in the same `describe.concurrent` block of `apps/server/test/services/plugins/plugin-install.test.ts`. Each one configures git by writing `GIT_CONFIG_COUNT`/`GIT_CONFIG_KEY_0`/`GIT_CONFIG_VALUE_0` into `process.env`, then restores the old values. The plugin service has no other way to receive git config: `runInstallCommand` spawns git with `process.env`. When both tests overlap, the shallow test overwrites `GIT_CONFIG_KEY_0` (`protocol.version` becomes `url.….insteadOf`) or its restore deletes the variables. The fallback test's probe `git fetch --depth 1 <repo> <sha>` then runs over protocol v2, which serves any commit, so it succeeds. That produces the CI failure `AssertionError: promise resolved "{ stdout: '', …(1) }" instead of rejecting` seen on #7893 and #7869. ## What changed - The two tests move into their own non-concurrent `describe.skipIf(!hasGit)("git sources configured through the server process environment")`, placed between the two concurrent suites. Vitest runs a non-concurrent sibling as its own group, after the preceding concurrent group finishes and before the next one starts (`partitionSuiteChildren` in `@vitest/runner`). So nothing else in the file runs while `process.env` holds their git config. Moving them out of "git sources" is required: `describe.concurrent` makes the suite itself concurrent, so "git sources" and "multi-plugin repositories" run in parallel, and `test.sequential` inside "git sources" would still overlap the other suite. - The probe git commands (`git clone` and `git fetch`) get their config through the child `env` option (`gitConfigEnv`) instead of `process.env`. `withProcessGitConfig` now wraps only the `service.install` call, which has no other config channel. - Nothing else in the file mutates `process.env` inside a concurrent block. The npm-config tests sit in sequential describes, and the file already gets an isolated worker because it mutates `process.env`. Test-only change; production code is untouched. ## How you verified - Reproduced on main by running only the two tests, so they always overlap: `vitest run test/services/plugins/plugin-install.test.ts -t "fetches only the resolved commit|falls back to a full clone"` failed **15/15** runs with the exact CI error (the fetch printed `* branch <sha> -> FETCH_HEAD`). - Same command with this change: **20/20** passed. - Full file, 8 consecutive runs: 8/8 passed (64/64 tests each). - `pnpm exec turbo run typecheck --filter=@bb/server` and `pnpm exec turbo run test --filter=@bb/server -- test/services/plugins/plugin-install.test.ts` both passed. > 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
bb registers some of its own UI (message time, the Info tab, thread actions, the parent-thread context segment) in the same shape a plugin uses. Those registrations carried two owner ids: message time and the Info tab used
core, while thread actions and the parent segment usedbb--core. The oldcoreid is also stored in users' saved panel tabs (plugin-fixed:core:info). Separately, thread actions and the parent segment read private app state (a jotai split-layout atom, route state, a zod schema with a private options list, a private clipboard helper) where the SDK already hands plugins a hook for the same thing.What changed
One owner id.
CORE_PLUGIN_ID = "bb--core"lives in@bb/domain, andcollectCoreContributionSlots(apps/app/src/lib/core-contributions.ts) stamps it on every core registration. The thread-action registry now maps core and plugin entries the same way, with no core branch. Message metadata, the secondary panel, panel tabs, Info-tab navigation andPaneThreadActionCommandHandlercompare against the constant.Saved Info tabs convert on read.
plugin-fixed:core:infobecomesplugin-fixed:bb--core:infothrough client-core's existing legacy-tab path (packages/client-core/src/panel/fixed-panel-tabs-state.ts). The bb guide's thread-inspection text is updated.Private imports replaced with the functions plugins get:
splitLayoutAtom+useRouteStateuseSidebarSplitLayout+useBbContextPARENT_NOTIFICATIONS_OPTIONSsatisfies Record<…>label mapcopyToClipboardWithToastcopyToClipboard+appToastuseThreadContextKindfromPluginThreadContextCardthread-context-card-pane.tsPROMPT_STACK_INLAY_SEGMENT_CLASSCONTEXT_CARD_SEGMENT_CLASS(same value)useBbContext,useSidebarSplitLayoutanduseThreadContextKindmove into small modules (plugin-bb-context.ts,plugin-split-layout.ts,thread-context-card-pane.ts) so core's boot code does not pull in the larger SDK hook modules.plugin-sdk-app-impl.tsxserves the same functions to plugins.bb--corechecks that stay:MessageMetadatarenders core entries outsidePluginSlotMount(the mount would load plugin CSS and bindPluginContextforbb--core);ThreadSecondaryPaneldoesn't recordbb--coreas a panel's plugin provider; the Info-tab checks remain while the Info body is core-fed; thebb--core/pin|read|archivecommand bindings remain.No user-visible change. The public-SDK boundary (
apps/app/src/core-contributions/, its lint rule and the build-time@get-bb/plugin-sdk/appbinding) that this PR originally carried is split out to a draft that waits on this one.How you verified
pnpm exec turbo run typecheck lint --filter=@bb/app --filter=@bb/client-core --filter=@bb/domain --filter=@bb/templates: 10/10.turbo run testfor@bb/client-core,@bb/domain,@bb/templates;@bb/appvitest oversrc/lib,src/components/{thread,plugin,secondary-panel,promptbox}andsrc/views/thread-detail: 376 files, 4206 tests passed. New tests cover thecore→bb--coreInfo-tab conversion.pnpm start:worktreeat this commit: message time renders with its full-date tooltip; the thread actions menu lists Copy link, Pin, Mark unread, Notifications, Rename, Regenerate title, Archive, Delete; Copy link shows "Thread link copied"; aplugin-fixed:core:infotab written intothread_tabsopens as the Info tab (the stored row keeps the old id until the client next saves the tab state, and converts again on every read). No page errors.🤖 Generated with Claude Code