Skip to content

Make the Claude Code provider plugin forkable - #4202

Merged
SawyerHood merged 1 commit into
bb/forkable-19-provider-pifrom
bb/forkable-20-provider-claude-code
Sep 23, 2026
Merged

SawyerHood merged 1 commit into
bb/forkable-19-provider-pifrom
bb/forkable-20-provider-claude-code

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

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

AGENT GENERATED

@SawyerHood
SawyerHood added this pull request to stack #4182 September 23, 2026 17:51
@SawyerHood
SawyerHood force-pushed the bb/forkable-20-provider-claude-code branch from 9cfacbd to 706bb72 Compare September 23, 2026 17:53
@SawyerHood
SawyerHood force-pushed the bb/forkable-20-provider-claude-code branch 2 times, most recently from 5ed08a1 to 625f459 Compare September 23, 2026 20:40
@SawyerHood
SawyerHood marked this pull request as ready for review September 23, 2026 21:07
@SawyerHood
SawyerHood force-pushed the bb/forkable-20-provider-claude-code branch from 625f459 to 7b34db3 Compare September 23, 2026 21:31
@SawyerHood
SawyerHood removed this pull request from stack #4182 September 23, 2026 21:40
@SawyerHood
SawyerHood added this pull request to stack #4220 September 23, 2026 21:41
The plugin'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 publishes: ThreadEvent and its item types from
  /provider-bridge/testing; PromptInput, JsonValue,
  RuntimePermissionPolicy, the interaction types and
  BRIDGE_INBOUND_REQUEST_METHODS from /provider-bridge. The threadScope
  and turnScope helpers move into the delta test harness.
- The recorded-conformance test replays the recordings committed under
  packages/provider-bridge-protocol through that package's worker entry,
  neither of which a copy has. It moves to @bb/provider-parity, whose test
  task already takes the provider plugins' sources as inputs.
- The vitest config imported the repository's vitest.shared.ts. It now
  uses defineConfig directly, and the test task depends on the SDK build.
- The fork installs without npm's peer resolution, so the plugin declares
  what its tests and types load: better-sqlite3, cron-parser, and hono for
  the fake plugin host, and @anthropic-ai/sdk, the Agent SDK's type-only
  peer.

docs/provider-bridge-protocol.md says where the recorded-conformance
tests live now.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@SawyerHood
SawyerHood force-pushed the bb/forkable-20-provider-claude-code branch from 7b34db3 to 3a5d62c Compare September 23, 2026 22:10
@SawyerHood
SawyerHood merged commit 257832b into main Sep 23, 2026
22 of 34 checks passed
@SawyerHood
SawyerHood deleted the bb/forkable-20-provider-claude-code branch September 23, 2026 22:14
SawyerHood added a commit that referenced this pull request Sep 23, 2026
## Human comments

## What was wrong

Last of four agent-provider PRs in the forkable built-ins stack; it
builds on #4202. `plugins/provider-codex`'s source already used only the
public SDK. A copy still failed:

- Tests imported `@bb/domain` and `@bb/provider-bridge-protocol`. Most
of that vocabulary the SDK publishes; three helpers it doesn't, nor the
protocol's `interactionRequestParamsSchema`, which the calibration test
parsed every approval request with.
- The recorded-conformance test needs the repository's recordings.
- The vitest config used `vitest.shared.ts`.
- The fake app server had 34 code comments.

## What changed

- **Imports:** tests use the public SDK. The scope helpers and the
standalone `/compact` prompt become test-local.
- **Calibration test:** it still parses every approval request with the
full interaction-request schema, now built from the payload schemas
`@get-bb/plugin-sdk/provider-bridge` publishes.
- **Recorded conformance:** the test moves to `@bb/provider-parity`,
beside Claude Code's, and `docs/provider-bridge-protocol.md` says
Codex's replay lives there too.
- **Config:** `defineConfig`, declared test peers, a lint script, and
turbo entries. The fake app server's comments are removed.

## How you verified

- `pnpm exec turbo run typecheck test lint
--filter=bb-plugin-provider-codex`.
- `pnpm check:plugin-forks plugins/provider-codex` passes in a copy.
- `@bb/provider-parity`, `@bb/scripts`, and `bb-plugin-plugin-api-docs`
tests; `@bb/app` typecheck.
- **Calibration schema:** its JSON Schema is deep-equal to the
protocol's `interactionRequestParamsSchema`. Deleting `providerThreadId`
from the bridge's interaction-request send fails the test with a
ZodError; a version that parsed only the one command approval it checks
passed with that mutation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant