Repository navigation
Enable bb cloud AI by default and remove its settings page - #4522
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 775aaa54d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .boolean() | ||
| .safeParse(await bb.storage.kv.get<unknown>(ENABLED_KEY)); | ||
| let enabled = stored.success && stored.data; | ||
| let enabled = stored.success ? stored.data : true; |
There was a problem hiding this comment.
Update opt-in guidance for the new default
For signed-in profiles without a saved enabled value—the path changed here—Automatic can now send prompts or diffs to bb cloud, but plugins/bb-ai/skills/bb-cloud-ai/SKILL.md:12-18, docs/configuration.md:227-229, and plugins/bb-ai/PLUGIN_OVERVIEW.md:6-16 still promise that nothing is sent until explicit opt-in and direct users to the deleted settings switch. This misrepresents an external data transfer and leaves users and agents following a nonexistent opt-out path, so update the required discoverable surfaces alongside the new default and UI removal.
AGENTS.md reference: AGENTS.md:L26-L27
Useful? React with 👍 / 👎.
## Human comments ## What was wrong bb cloud (the `bb-ai` plugin, #4254) only served thread titles and commit messages. Voice input had no hosted option, so a bb without a Codex login had no microphone. The plan left voice as phase 2 (`plans/bb-account-and-hosted-generation.md`, Part 8). The bb side already had everything voice needs: the plugin SDK's `transcribe` hook, the Voice input row in Settings → AI services, the server's transcribe route, `bb voice transcribe`, and the mic's readiness check. The missing pieces were a hosted endpoint and bb-ai implementing `transcribe`. ## What changed - **bb-ai-gateway** (`apps/ai-gateway`): new `POST /api/ai/v1/transcribe`. - Takes `{audio, format, hint}` with base64 audio, capped at 10 MB, and forwards it to OpenRouter's `POST /api/v1/audio/transcriptions` with `provider: {zdr: true, data_collection: "deny"}`. - Metering is shared with `/complete` through one `handleMetered` path: the same auth, rate limit, daily budget and request log. Transcription reserves 2¢ per call and settles to the reported cost. - `AI_TRANSCRIBE_MODELS` (new, required var, set in `wrangler.jsonc` for production and staging) lists the models in order. OpenRouter's transcription endpoint has no `models` fallback, so the gateway moves to the next model when one answers with an HTTP error, all within an 8 s deadline. It never retries after a timeout. - The vocabulary `hint` goes to `provider.options.groq.prompt`, the only hint option OpenRouter documents. - Default models: `microsoft/mai-transcribe-2`, then `openai/whisper-large-v3-turbo`. Both have ZDR endpoints. - **bb-account**: `bb-account.v1.fetch` accepts request bodies up to 16 MB instead of 1 MB, since base64 recordings didn't fit. Responses stay capped at 1 MB. - **bb-ai**: registers `transcribe`. - It sends the recording through `bb-account.v1.fetch` with a 10 s timeout. - It maps the MIME type or file extension to an OpenRouter format, so Chrome's `audio/webm;codecs=opus` becomes `webm` and Safari's `audio/mp4` becomes `m4a`. - It refuses recordings over 10 MB or in unknown formats without contacting getbb.app. - The opt-in, sign-in and used-up-budget checks are shared with `complete`. - bb cloud now appears for Voice input, and Automatic tries Codex, then bb cloud. - **Copy and docs**: `bb ai` help, the plugin README, overview and skill, `docs/configuration.md`, and the verify-bb feature map now cover voice input and say recordings are never stored. (Merged with #4522, which made bb cloud on by default and removed its settings page and disclosure, and #4525, which deleted the plan doc. The model comparison that was going into the plan is below.) **Model choice** (OpenRouter transcription models with ZDR endpoints, 2026-09-29): `microsoft/mai-transcribe-2` (Azure, about $0.0017/min at a launch price that ends 2026-12-31, #1 on FLEURS and #2 on Artificial Analysis's word-error-rate board), `openai/whisper-large-v3-turbo` (Groq/DeepInfra, $0.0002–0.0007/min, takes a vocabulary prompt on Groq), and Voxtral Mini Transcribe, Deepgram Nova-3 and AssemblyAI Universal-3.5 Pro. `openai/gpt-transcribe`, `google/gemini-3.5-transcribe` and `x-ai/grok-stt-1.0` have no ZDR endpoint. - **Stale docs from #4522**: the `bb-cloud-ai` skill, plugin overview, README, `docs/configuration.md` and the verify-bb feature map still described the removed opt-in and settings page. They now say bb cloud is on by default once you sign in, `bb ai off` turns it off, and disabling the plugin also stops it. The skill also covers voice input: accepted formats, the 10 MB limit, the 10 s timeout, and `bb voice transcribe`. No server, daemon or SDK changes. No `HOST_DAEMON_PROTOCOL_VERSION` bump. **Known issue, not addressed here:** through OpenRouter, MAI-Transcribe 2 answers 400 for WebM and MP4 audio but accepts the same speech as Ogg or MP3. Chrome and Safari recordings therefore get transcribed by Whisper after one refused MAI call. The follow-up is either to put Whisper first in `AI_TRANSCRIBE_MODELS` (config only) or to convert recordings to Ogg before upload. ## How you verified - `pnpm exec turbo run typecheck test lint --filter=@bb/ai-gateway --filter=bb-plugin-bb-ai --filter=bb-plugin-bb-account`: pass (gateway 32 tests, bb-ai 28, bb-account 59). - New gateway tests cover: - the exact OpenRouter request, including ZDR and the Groq hint, and the metering and request log, which never contains audio or text; - falling back on an HTTP error but not on a timeout; - charging nothing when every model refuses; - input validation (base64, the 10 MB cap, format, hint size); - the 2¢ reserve, so a nearly spent budget still allows a title but not a recording; - 401 without a credential; - a Miniflare test that sends a 4 MB body through the real Workers runtime and D1. - New bb-ai tests cover the fetch payload and timeout, refusals that send nothing (off, too large, unknown format), budget exhaustion from a transcription answer, and MIME/extension mapping. - Local end to end against real OpenRouter (`pnpm cloud:dev` with a key, plus `pnpm dev` signed in to a local account, `bb ai on`, and `bb settings ai-services set voice bb`): - `bb voice transcribe` on WebM, MP3 and M4A clips returned correct transcripts in 1.0–1.6 s. The gateway log showed MAI answering MP3 and Whisper answering WebM and M4A. - `bb ai usage` counted the requests. - After merging `main`: typecheck, test and lint pass again (bb-ai 24 tests, gateway 32, bb-account 59). - Recording with the mic in the app worked. ## Rollout Deploy the gateway (**Deploy AI Gateway**) before releasing bb-ai. A released bb-ai against an old gateway would show the mic and fail every recording with a 404. > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Human comments
What was wrong
BB cloud AI required a separate opt-in even for signed-in accounts, and exposed a dedicated settings page for a service that can already be disabled as a plugin.
What changed
Enable bb cloud AI when no saved preference exists, preserving saved opt-outs. Remove the plugin settings page, its disclosure text, and unused frontend dependencies. Keep CLI controls and usage reporting, and update CLI help to reference the remaining controls. Markdown documentation is unchanged at the owner's request.
How you verified
pnpm exec turbo run test lint typecheck prepare:bundled --filter=bb-plugin-bb-aipassed; all 20 remaining tests passed.git diff --checkpassed.