Route AI features through bb Cloud - #1034
Draft
ymichael wants to merge 7 commits into
Draft
Conversation
ymichael
force-pushed
the
bb/plan-for-metadata-inference-thr_ujvarx7qmi
branch
2 times, most recently
from
August 6, 2026 22:32
6376543 to
6229342
Compare
POST /api/connect/ai/inference (gpt-5.6-luna structured output) and /api/connect/ai/transcription (gpt-transcribe) let a paired bb run title, commit-message, and voice AI through its bb Cloud account. Auth is header-only via the existing pairing/machine credential; usage is metered as estimated cost in micro-USD against a $2/day per-account abuse budget (atomic D1 upsert, refunded on upstream failure). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fetchAiInference/fetchAiTranscription wrap the gate's /api/connect/ai/* endpoints with the stored pairing credential, zod-validated responses, and a typed ConnectAiError (unauthorized/quota_exhausted/server_error/network/ invalid_response) so callers can route fallbacks; aborts re-throw untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
experimental_registerCloudAiProvider lets a plugin (the builtin connect plugin for bb Cloud) offer a cloud route for thread-title/commit-message inference and voice transcription. inferenceComplete and transcribeVoiceInput try an available provider first and fall back to the locally configured providers on failure; timeouts keep existing semantics. Result-shaped contract so it survives plugin bundling; single slot, unregistered with the plugin's dispose hooks. Audit entry in docs/api_to_audit.md per the plugin API rule. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The connect plugin now registers a CloudAiController with the host's cloud AI seam: when paired (and the new AI features setting is on), thread titles, commit messages, and voice transcription run through the account's /api/connect/ai proxy. A rejected credential latches until re-pair; budget exhaustion cools down for 5 minutes; transient failures fall back to local providers per call. Setting surfaces: the settings section (retitled "bb Cloud") gains an AI features toggle, status/setCloudAi RPCs carry it, and `bb connect ai on|off` sets it from the CLI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
One user-facing name for the getbb.app relationship: "bb Cloud". The connect plugin's settings section, sidebar action, manifest, CLI help, and status copy drop "Remote access" as the umbrella (it stays as a capability description); docs, the bb guide, and the bb-cli skill describe the connected AI features (cloud routing, local fallback, daily budget, privacy note) and the new bb connect ai command. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ymichael
force-pushed
the
bb/plan-for-metadata-inference-thr_ujvarx7qmi
branch
from
August 6, 2026 23:05
6229342 to
823f36b
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.
Summary
connectand thebb connectsetup/management command@bb/connect-clientcalls and an experimental plugin provider seam so the server can try bb Cloud before locally configured AI providersResponsibility boundaries
Contract changes
POST /api/connect/ai/inferencewith{ prompt, schema } -> { value }POST /api/connect/ai/transcriptionwith multipartfile/optionalprompt->{ text }fetchAiInference,fetchAiTranscription, andConnectAiErrorto@bb/connect-clientCloudAiProviderandbb.experimental_registerCloudAiProvider(...)to the public plugin SDKopenSettings({ sectionId }); action glyphs are distinct from the plugin branding iconcloudAiEnabledto connect status plussetCloudAiRPC andbb connect ai [on|off]bb connectCLI compatibilityData model
ai_usage, keyed by(user_id, UTC day), containing estimated aggregate spend in micro-USDcloudAiEnabled, defaulting to true when absentLifecycle and fallback behavior
bb connect offunlinks the shared Cloud pairing, stopping remote access and making Cloud AI unavailableTest coverage
bbCLI title-generation E2E completedDraft blockers / follow-ups
packages/connect-db/migrations/0006_ai_usage.sqlin commita66961246.origin/mainat85c49bc3c.