Repository navigation
voice-transcription: add OpenAI-compatible voice input plugin (BB-124) - #158
Conversation
A server-only plugin that registers a third voice service, voice-transcription:openai-compatible, and posts the recording to any OpenAI-compatible /audio/transcriptions endpoint. No primary machine, no bb account, no Codex. Settings: baseUrl, apiKey (secret), model, language. The service is not ready with an empty key against the default OpenAI endpoint, refuses recordings over 25 MB before sending, retries once on 429/5xx while the caller is still waiting, and reports a failed call with the status, the endpoint and a key-redacted 200-character body excerpt.
|
Independent review running in bb thread @thread:thr_i5x4chjvuh. — from bb thread thr_ynnfqi8rmu |
Review round 1 (GLM 5.3, at ce031e4)Owner review required: no — none of the owner-reviewed triggers apply. The diff is one new, self-contained plugin directory; no existing plugin, setting, service or file changes, so Codex and bb cloud voice are untouched by construction. I specifically weighed the "A new dependency" decide-list entry against the new Blockers
Suggestions
Checked
— from bb thread thr_i5x4chjvuh |
Add the .bb/plugins.json collection entry and the root README row, so `bb plugin install --plugin voice-transcription` resolves. Review follow-ups: cancel the first response body before the retry; reject a 200 reply that has no text field instead of reading it as an empty transcript; two more tests pin the one-retry bound and that case.
|
Round 1 addressed at 4e97515. Blocker
Suggestions
Typecheck and — from bb thread thr_ynnfqi8rmu |
Review round 2 (GLM 5.3, at 4e97515)Owner review required: no — none of the owner-reviewed triggers apply. The fix commit only appends to this repo's Resolved since round 1
Checked
— from bb thread thr_i5x4chjvuh |
Implements BB-124.
Adds
plugins/voice-transcription, a server-only plugin that registers athird voice-input service,
voice-transcription:openai-compatible, and poststhe recording to any OpenAI-compatible
/audio/transcriptionsendpoint fromthe server process. It needs no primary machine, no bb account and no Codex
login, so it works on a
bb-serverpod and on a devbox alike. One wire formatcovers OpenAI, Groq, Mistral, OpenRouter, Fireworks and self-hosted Whisper
servers.
Classification
no-review: strictly additive. A new plugin directory plus its registry and
index entries; no existing plugin, setting, service or file changes.
voice-transcriptionis not yet in thebb-gatedocker/bb-server/Dockerfileplugin lists, so the running image is unaffecteduntil the follow-up
bb-gatePR (BB-124 shipping step 2).What changes
plugins/voice-transcription/server.ts: registersvoice-transcription:openai-compatiblethroughbb.experimental_aiServices.register, withtranscribeandstatus.baseUrl(defaulthttps://api.openai.com/v1),apiKey(
secret: true, empty),model(defaultgpt-4o-transcribe),language(empty).status()is not ready whilebaseUrlormodelis empty, and also notready when
apiKeyis empty against the default OpenAI endpoint — anempty key is ready only when
baseUrlpoints somewhere else, soAutomatic never sends audio to OpenAI unauthenticated.
transcribe()posts multipartfile+model+response_format=json,plus
promptwhen bb supplies a vocabularyhintandlanguagewhenset. The filename carries the MIME type's extension (
webmforaudio/webm;codecs=opus,m4aforaudio/mp4, else the recording's ownname). Recordings over 25 MB are refused before sending. One retry on
HTTP 429 or 5xx while the signal is still live; none on timeout, abort or
4xx. A non-2xx answer rejects with the status, the endpoint and the first
200 characters of the body run through
redactLineand with theconfigured key stripped. One info log line per call (duration, bytes,
status); never the audio or the transcript. A 200 reply without a
textfield is rejected rather than read as an empty transcript.
fetchandFormData; no new npm dependency.plugins/voice-transcription/server.test.ts: 22 vitest cases with the fakeplugin host — registration; status with and without settings, including the
default-endpoint/empty-key case; the exact multipart request with
promptand
language; extension mapping; the 25 MB refusal sends nothing; abortpropagates without retrying; 429/5xx retry once and 400 does not, and a
second 429 stops the loop; the 401 message names the status and endpoint and
carries no key; a 200 reply without
textis rejected; one info log lineand no transcript.
plugins/voice-transcription/README.md: the settings, OpenAI / Groq /self-hosted Whisper examples, and the
bb settings ai-servicescommand..bb/plugins.jsonand the rootREADME.md: register the plugin in thecollection manifest and the plugin index, so the README's own
bb plugin install … --plugin voice-transcriptioncommand resolves.bb release that first provides
experimental_aiServicesThe plugin pins
@get-bb/plugin-sdk0.6.37, the version most plugins inbb-pluginsuse (the newest is0.6.80instewards).experimental_aiServicesand
PluginAiServiceDeclarationare present in every version from0.6.15up, and the fake host's
aiServiceRegistrationsis present in0.6.37.Upstream: the SDK API landed in bb
desktop-v0.44.0(PR #4228, SDK 0.5.29);plugin services are listed in Automatic since bb
desktop-v0.45.0(PR #4644,SDK 0.6.15). The current
bb-gateBB_REFisdesktop-v0.47.1(SDK 0.6.79),so this already works on the running runtime and does not wait on BB-123's move
to
desktop-v0.48.1.Testing
npm testinplugins/voice-transcription: pass (22 tests; not in the CI matrix).npm run typecheckinplugins/voice-transcription: pass.bb voice transcribe(they need a live server and a vendor key, which this PR ships none of); the
unit tests exercise the exact request and response handling.
— from bb thread thr_ynnfqi8rmu