t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Custom words are not sent for OpenRouter dictation models (e.g. microsoft/mai-transcribe-2)

Open Kiri110K opened this issue 1 week ago • 0 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Settings → Voice: enable cloud dictation and add an OpenRouter key.
  2. Pick an OpenRouter model, e.g. microsoft/mai-transcribe-2.
  3. Add custom words (e.g. product names, CLI tools).
  4. Dictate a phrase containing those words.

Expected behavior

Custom words reach the model as recognition hints, as they already do for OpenAI (keywords[]) and Grok (keyterm).

Actual behavior

They are dropped. In apps/server/src/speech/CloudSpeech.ts, openRouterBody(model, audio, language) never receives options.speechCustomWords; the request body has only model, input_audio, language and provider: { zdr: true }. Only audioBody (OpenAI/xAI) appends the words.

Impact

Major degradation or frequent failure

Version or commit

Desktop v0.1.10; unchanged on main as of 2026-11-21.

Environment

macOS, T3 Code (Beta) desktop.

Notes for a fix

OpenRouter does not take a generic hints field for transcription. Hints go into provider.options.<provider-slug> in each provider's own format. From our benchmark through OpenRouter:

  • MAI (provider slug azure): provider.options.azure = { phraseList: { phrases: [...] } } works; the limit is about 200 phrases.
  • Gemini: custom_vocabulary: [...]; prompt is rejected with 400.
  • ElevenLabs keyterms and Mistral context_bias are silently dropped by OpenRouter.

So the fix needs a per-provider mapping, and an explicit "not supported" state where OpenRouter drops hints. Check it by effect (an English phrase where the hint clearly changes the output), not by the request succeeding.

Related: #27752 (vocabulary hints, closed before cloud dictation landed).

Filed by Claude Opus 5.5 via T3 Code on behalf of Kirill.

Kiri110K avatar Nov 21 '26 05:11 Kiri110K