Add generic provider env contribution hook for plugins - #3035
Draft
SawyerHood wants to merge 5 commits into
Draft
Conversation
This was referenced Sep 4, 2026
SawyerHood
force-pushed
the
bb/provider-env-contribution
branch
from
September 4, 2026 04:39
56a5f8d to
969ab39
Compare
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.
Stack layer 1 of 3 (bottom). No prerequisite; layers 2 (account-pool plugin) and 3 (pool wiring) build on it.
Human comments
What was wrong
Plugins could register providers and derive provider options, but there was no validated, per-provider hook for contributing environment variables on each daemon command. As a result the server had nothing to resolve, the versioned host wire carried no contribution metadata, the daemon could only build its fixed shell environment, and Claude did not rebuild its resident SDK session when a turn's merged environment changed. This implements BB-89.
What changed
bb.providers.experimental_contributeEnv(providerId, resolve)with public context and entry types, zod boundary validation, fake-host support, Plugin Guide coverage, the API audit entry, and Plugin API map inventory. The Plugin SDK version is now 0.4.44.contributedEnvcommand payloads and bumpedHOST_DAEMON_PROTOCOL_VERSIONto 180.serverPathvalues against the daemon's loopbackBB_SERVER_URL, and persistedprovider.env-resolvedevents with contributed secrets masked. If that base URL is unavailable, the daemon drops only the unresolved entry, records it as masked, and emits a configuration warning naming the variable and plugin instead of preventing thread startup.Execution settings changed; the Claude session was rebuilt to apply them.Ordinary context-preserving session replacements remain hidden.How you verified
node .github/workflows/check-plugin-sdk-version.mjspnpm exec turbo run typecheck test --filter=@get-bb/plugin-sdk --filter=@bb/plugin-api-map --filter=@bb/domain --filter=@bb/host-daemon-contract --filter=@bb/thread-view --filter=@bb/provider-bridge-protocol --filter=@bb/agent-runtime --filter=@bb/provider-bridge-acp --filter=bb-plugin-provider-codex --filter=bb-plugin-provider-claude-code --filter=bb-plugin-provider-pi --filter=@bb/server --filter=@bb/host-daemon --continue --force(all typechecks passed; 33/34 test tasks passed, with one load-sensitive Pi test timing out)pnpm exec turbo run test --filter=bb-plugin-provider-pi --force(21 files and 121 tests passed sequentially, including the timed-out test)pnpm exec turbo run typecheck test --filter=@bb/agent-runtime --filter=bb-plugin-provider-claude-code --continue --forcepassed both typechecks, 22 agent-runtime files / 319 tests, and 25 Claude files / 357 tests.pnpm exec turbo run test:integration --filter=@bb/agent-runtime --forcepassed 9 files and 64 tests, including the refreshed live Claude coverage.pnpm parity --old <dbc16017c9 checkout> --new . --allowlist <empty external allowlist>(48 passed, 0 failed, 4 process-only cells skipped)scripts/bb-dev-app current, installed a throwaway path plugin, and verified Claude Code, Codex, and ACP Cursor received the marker, secret, and loopback-expanded URL while the event masked the secret.Fixes BB-89