Repository navigation
Description
Part of #3705.
Blocked by #3706
Context
Source pointers verified on main a63e564f02f9b1ab0462bb0ac02dbf8ea6eacee7 on 2026-11-08; verify named anchors again at pickup.
(speechProvider, packages/ui-server/src/app.ts:240-240), (pickSpeechProvider, packages/ui-server/src/voice/speech-providers.ts:127-155) and (createVoiceRoutes, packages/ui-server/src/routes/voice.ts:19-58) currently accept/select one provider. (app.put(path, packages/ui-server/src/routes/transcriptions.ts:82-111) independently selects the active provider before claiming a saved-audio receipt. Follow the approved design produced by #3706, not unapproved examples. The epic holds the shared compatibility and authority rules.
Scope
Implement multi-provider registration/discovery and deliberate per-operation resolution through the existing SpeechProvider and ASR model. Supply authenticated persisted dictation-default APIs consumed by the Settings child; preserve the exact approved ownership/precedence/compatibility rules.
Bind the selected/disclosed provider identity and capability snapshot at capture/upload admission. Keep active captures and saved-recording receipts/retries on their original provider even when another device changes the default. Missing/unavailable/unknown selections fail visibly; discovery never mints a credential and failures never pick another vendor/browser recognizer.
Out of scope
The Gemini protocol/client adapter, Settings visuals, dictation-versus-live gestures, provider credentials UI, new plugin/provider seams and changing existing saved-recording retry/tombstone/unknown-outcome policy.
Acceptance criteria
- Approved registration/discovery/default/selection schemas are implemented and documented, with duplicate/invalid ids refused and no credential/key material in discovery/errors.
- Existing single supplied
speechProvider, environment/built-in selection and external by-value consumers retain the approved documented compatibility; browser speech remains opt-in. - Actual mounted routes select the exact requested/default provider in zero/one/multiple cases. Unknown, removed, unusable and unauthorized/stale preference updates have the approved outcomes without another provider being invoked.
- A held session-mint/upload crossing a default change cannot send data or create a receipt for a different provider; ordinary repeat/retry never redispatches under a new provider identity.
- Method-derived saved-audio capability remains honest. Selecting a streaming-only provider cannot silently transcribe through another service; local recordings remain available for playback/retention.
- Public schemas/types/client APIs, environment descriptors and authoritative contract/HTTP docs match the implementation. Required changeset/conformance proof preserves existing external adapters.
- A named mutation removing provider binding or enabling implicit fallback fails the intended mounted-route assertion and passes after restoration.
Verification
Use keyless provider doubles installed below the shared request path, actual authentication/mounted routes and held concurrency boundaries. Run focused server/SDK tests including external speech and saved transcription, typecheck/lint, the affected provider-history guard, and required PR preflight. No test network/vendor credential.
Contract impact
Additive SDK/construction/configuration, supported HTTP/discovery/settings/session selection and client API surfaces. CONTRACT: implementation, authoritative docs/schema/API report updates and minor changeset. Preserve existing meanings; a necessary break goes back for a maintainer ruling.
Approved design (folded 2026-11-08 from #3706)
Follow the selectable-dictation plan §4, §5, §8 and §9, and the maintainer's decision D1–D4. Binding specifics:
- Registered set is fixed at construction: Deepgram when
DEEPGRAM_API_KEYis set, Gemini whenGEMINI_API_KEYis set (once ui-react, ui-server: add Gemini 3.5 Transcribe Live dictation #3708's built-in exists; D3), browser speech only viaVOICE_PROVIDER=webspeech, plus newcreateApp({ speechProviders }). The legacyspeechProviderstill replaces every built-in. Supplying both options, or any duplicate id, is a construction error. - Host default:
defaultSpeechProviderId??VOICE_PROVIDER??deepgramwhen it is registered. An unregistered host default is a construction error. - Effective provider: the saved brain-wide default if registered. A saved default that is not registered blocks dictation, with no fallback. Otherwise the host default, otherwise the only registered provider, otherwise none (a choice is required when 2+ are registered). The §4 table is the acceptance matrix.
GET /api/voice/providers(read-only, never mints) returnsproviders[](id,label,destination?,capabilitiesincl. the new optionalsmartTranscription) anddictation { saved, savedUsable, host, effective, source, smart, revision }.GET /voice/capabilitiesstays unchanged and reports the effective provider.GET/PUT /api/voice/dictation/settingsis stored as KVvoice.dictation{ defaultProvider, smart (default true), revision }. Writes useIf-Match, need a human owner (owner/ambient) and enforce that on this route. Error codes:400 speech_provider_unknown,409 dictation_settings_stale(withcurrent),428whenIf-Matchis missing,403 owner_required. The route is separate from ui-react: configure the default live-conversation provider through Settings #3616's live-service route.POST /voice/sessiontakes an optional body{ providerId, smart }. WhenproviderIdis present it is exact or409 speech_provider_unavailable, with no mint and no substitution. An absent body keeps the legacy resolution.- Saved audio: the upload header
Speech-Providerselects exactly that provider (409 speech_provider_unavailable/501 saved_audio_unsupportedbefore the claim).claimrefuses a retry whose provider differs from the receipt's with409 transcription_provider_mismatchand attaches the receipt. A missing header keeps the legacy resolution. - SDK: optional
SpeechProvider.label/destination,createSessionoptionmode?: "smart" | "verbatim",SpeechCapabilities.smartTranscription?. Protocol typesVoiceProvidersResponse,DictationSettings,VoiceSessionRequest. Client APIvoiceSession(signal, { providerId, smart }),voiceProviders(),dictationSettings()/saveDictationSettings(). - Mutations (§9): substituting the effective provider for
providerId→ the held-mint test fails; resolving the upload from the current default instead of the header → the held-upload test fails.
Source re-verified at main a63e564f0: the upload names no provider (const response, packages/ui-react/src/lib/recordings.ts:775-777), and the retry check compares only the attempt id (claim(, packages/ui-server/src/voice/transcription-store.ts:63-75).
Readiness
The approved schema and authority rules are folded in above. Ready once #3706 closes. No unresolved ruling remains.
Activity
schlessera commentedon Nov 8, 2026
2026-11-08: Folded the approved #3706 design (maintainer rulings D1–D4, schemas, states and proof split) into this body under Approved design. Source pointers were re-verified at main
a63e564f0. Design PR: #3713.schlessera commentedon Nov 8, 2026
Claiming (claim token
wi-3707-d12e), branchfeat/3707-selectable-dictation-providers. The approved design is folded in from #3706 (PR #3713, awaiting its merge lease). Expected overlap with #3708 is limited to the optional SDK fields both briefs name.docs(voice): design selectable dictation providers and Gemini Transcr…
schlessera commentedon Nov 8, 2026
Unblocked: #3706 is closed, so
scripts/sync-project.tsis removing theblockedlabel.Merge #3707 registry into the Gemini dictation branch
schlessera commentedon Nov 8, 2026
Delivered by #3715, squash
18a0ba3on main, milestone 0.45.0. It adds a multi-provider dictation registry,GET /voice/providers,GET/PUT /voice/dictation/settings, exactproviderIdsession binding, theSpeech-Providerupload binding and thetranscription_provider_mismatchretry guard. Legacy single-provider behaviour is unchanged. During review, legacy misconfiguration was restored to a route-time 500 rather than a boot failure; the PR records the mutation receipt. Candidate proof run 42487214057 passed. One earlier run failed on an unrelated deadline flake, now filed as #3723. Gemini registration lands with #3708 and the Settings UI with #3709.