Repository navigation
Make the Pi provider plugin forkable - #4201
Merged
SawyerHood merged 1 commit intoSep 23, 2026
Merged
Conversation
SawyerHood
force-pushed
the
bb/forkable-19-provider-pi
branch
2 times, most recently
from
September 23, 2026 18:07
215ae6b to
ab2aa41
Compare
SawyerHood
force-pushed
the
bb/forkable-19-provider-pi
branch
from
September 23, 2026 20:40
ab2aa41 to
2a1d895
Compare
SawyerHood
marked this pull request as ready for review
September 23, 2026 21:07
SawyerHood
force-pushed
the
bb/forkable-19-provider-pi
branch
from
September 23, 2026 21:31
2a1d895 to
78e8eb8
Compare
A copy of provider-pi could not install or run its tests: - Its app imported Button, cn, and the question form host from @bb/shared-ui. It now imports @/components/ui/button, @/lib/utils, and @/components/ui/question-form-host, the registry item whose flavor re-exports experimental_useQuestionFormHost, so engines.bbPluginSdk moves to >=0.5.22. tsconfig maps @/ the way thread-list does, plus the question-form-host flavor. Its paths for @get-bb/plugin-sdk and /app are gone: vitest now follows tsconfig paths, which sent the SDK to its .d.ts, and the package exports' types condition already names the same bundled declarations for tsc. - The delta translation test imported the assembler and ThreadEvent from workspace packages. It now uses experimental_createDeltaAssembler and ThreadEvent from @get-bb/plugin-sdk/provider-bridge/testing and builds its two scope literals itself. - The recorded-conformance test replays recordings committed under packages/provider-bridge-protocol, which a copy does not have. It moves to @bb/provider-parity, whose test task already takes the plugin's sources as inputs and now also takes the SDK's, which the replayed bridges load. docs/provider-bridge-protocol.md says where it lives. The vitest config uses defineConfig, the plugin declares the SDK test harness's peers its tests load, and the lint script removes 51 comments; the README keeps what the fake pi's header and the Bun test explained. The plugin fork CI job installs Bun, like the packages test shard, because a copy runs pi's Bun runtime regression, which requires Bun in CI. The app test that checks pi's answer shortcuts loads the plugin by path under the app's own plugin runtime, because the SDK test runtime backs the question form host with an empty host. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SawyerHood
force-pushed
the
bb/forkable-19-provider-pi
branch
from
September 23, 2026 22:10
78e8eb8 to
624475a
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 23, 2026
## Human comments ## What was wrong Third of four agent-provider PRs in the forkable built-ins stack; it builds on #4201. `plugins/provider-claude-code`'s source already used only the public SDK, but a copy failed to typecheck and test: - Tests imported `@bb/domain` and `@bb/provider-bridge-protocol` for vocabulary the SDK already publishes. - The recorded-conformance test replays recordings committed under `packages/provider-bridge-protocol` through that package's worker entry, neither of which a copy has. - The vitest config used `vitest.shared.ts`. - `@anthropic-ai/sdk` is a type-only peer of the Agent SDK, and the fork installs without peers. ## What changed - **Imports:** tests import from `@get-bb/plugin-sdk/provider-bridge` and `/provider-bridge/testing`, including `BRIDGE_JSON_RPC_ERRORS`, which a bridge test added on main imported from `@bb/provider-bridge-protocol`. `threadScope` and `turnScope` move into the delta test harness. - **Recorded conformance:** the test moves to `@bb/provider-parity`, whose test task already takes the provider plugins' sources as inputs. `docs/provider-bridge-protocol.md` says Claude Code's replay lives there too. - **Config:** `defineConfig`, a test entry that depends on the SDK build, declared test peers plus `@anthropic-ai/sdk`, and a lint script. The workspace dev dependencies are gone. ## How you verified - `pnpm exec turbo run typecheck test lint --filter=bb-plugin-provider-claude-code`. - `pnpm check:plugin-forks plugins/provider-claude-code` passes in a copy. - `@bb/provider-parity` tests, including the moved conformance cases; `@bb/scripts`, `bb-plugin-plugin-api-docs`, and `@bb/app` typecheck. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED
SawyerHood
pushed a commit
that referenced
this pull request
Sep 24, 2026
## Human comments Got my clanker to do some prep work for making the KB shortcut + enter flow better and realized we could pay off some tech debit while here. Turns out your clanker handled the "enter to submit" side of things with #4139, this just does some prep to ensure we benefit from that on the pi side of things too. <img width="300" alt="image" src="https://github.com/user-attachments/assets/2dd113cb-9837-42c8-a983-61a54b93221a" /> ## What was wrong Pi's RPC `select` dialogs used a separate radio-list implementation instead of BB's shared `QuestionForm`. That duplicated choice and shortcut handling, allowing the Pi prompt's keyboard behavior to diverge from AskUserQuestion. ## What changed Render Pi RPC `select` interactions with the shared `QuestionForm`. Adapt Pi's string options to the shared question model and map the selected answer back to the original string expected by Pi. Keep the existing Pi-specific `confirm`, `input`, and `editor` renderers unchanged. The pending-interaction shell already displays the interaction title, so the form renders only Pi's `message` as the prompt (omitted entirely when Pi sends none), avoiding a duplicate title. Since #4139 merged, the shared form submits after a numbered selection with Enter, and Pi RPC selects inherit that through this integration. The branch also adapts to #4201's forkable-plugin registry imports (`@/components/ui/*`). ## How you verified - `pnpm exec turbo run test --filter=@bb/app --filter=bb-plugin-provider-pi -- src/components/plugin/PluginPendingInteractionComposer.test.tsx app.test.tsx` - App integration: 13 tests passed. - Pi plugin: 9 tests passed. - `pnpm exec turbo run typecheck --filter=@bb/app --filter=bb-plugin-provider-pi` (and `@bb/shared-ui` after the title fix) - `git diff --check` - Manual QA in a nested source dev instance: a Pi RPC select prompt (Landstrip permission) rendered without a duplicate title; number shortcut selected the option and Enter submitted it; pointer selection and Submit answer also worked. Related: #3719, #4137, #4139, #4201 > AGENT GENERATED
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
Second agent-provider PR in the forkable built-ins stack; it builds on #4200.
plugins/provider-picouldn't be copied out:Button,cn, and the question form host from@bb/shared-ui.ThreadEventfrom workspace packages.packages/provider-bridge-protocol.What changed
experimental_useQuestionFormHost(Expose the question form host through the SDK and the registry #4181), soengines.bbPluginSdkrises to>=0.5.22. The SDK path entries are gone from the tsconfig.experimental_createDeltaAssemblerandThreadEventfrom@get-bb/plugin-sdk/provider-bridge/testing.@bb/provider-parity, anddocs/provider-bridge-protocol.mdsays pi's replay lives there.@bb/provider-parity#testnow takespackages/plugin-sdk/src/**andpackages/plugin-sdk/package.jsonas inputs, because the replayed bridges load SDK sources.defineConfig, declared peers, and turbo entries; the 51 comments are removed, and the README keeps what the fake pi's header and the Bun test explained.How you verified
pnpm exec turbo run typecheck test lint --filter=bb-plugin-provider-pi; a Bun-only case is skipped without Bun.pnpm check:plugin-forks plugins/provider-pipasses in a copy.@bb/provider-parity, including the moved recorded conformance and the pi parity replays;apps/app/src/components/plugintests; and the server's first-party provider plugin tests.turbo --dry=jsonreported the same@bb/provider-parity#testhash after a change to an SDK source; with them, the hash changes.app.cssis byte-identical. An unminifiedapp.jsdiffers only in the question-form-host source (the runtime shim became the SDK facade's hook, the same host context) and formatting.🤖 Generated with Claude Code