Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(dictation): keep the STT dictionary out of the decoder prompt (BUG-211)
rubenluetke10-beep27110f04a1d8
diff --git a/docs/BUGS.md b/docs/BUGS.mdindex 43c73b9b27..1f0c8e4378 100644--- a/docs/BUGS.md+++ b/docs/BUGS.md@@ -14825,3 +14825,45 @@ off-Windows no-op), `tests/unit/platform/test_deescalate.py`**Related.** BUG-204 (the VRAM holder this amplified), BUG-189 (the cold-bootstart storm the priority made fatal), AP-17 (the task stays `RunLevelLimited` — priority is orthogonal to elevation).++## BUG-211: dictation pasted dictionary words nobody said ("IDE, gone.") (HIGH, FIXED 2026-09-01)++**Symptom.** A dictation lands in the document with a dictionary term the+user never spoke — "IDE." on a 0.8 s near-silent press, "IDE, gone.",+"IDE, noFableForCent, …" — and longer recitations ("IDE, Agentic IDE,+Agentic IDE, Agentic") show up in the log as stripped echoes five times in+sixteen minutes. Words that only resemble a dictionary term also arrive as+the term, and the whole lane feels laggy.++**Root cause.** Two things stacked. A user-scope environment variable+(`JARVIS__STT__PROVIDER=groq-api`) overrode the `faster-whisper` the config+file names, so every dictation ran on cloud Whisper — 208 of 208 history+rows that day — even though the local engine was installed in the app's+interpreter. The dictation lane then handed the STT dictionary+("GitHub, Grok, Claude, Agentic IDE, Agentic") to that provider as the+Whisper `prompt`. Whisper answers a pause or silence by reciting the primed+list; `strip_prompt_echo` (BUG-185) removes a RUN of items but must leave a+single one alone, because "Claude." is something a person says. The local+engine never receives a prompt by design, which is why the defect only+appeared once the crossover put a prompt-capable provider in front. The lag+is the cloud round-trip per window (median 440 ms, p90 1.6 s, max 10.9 s).++**Fix.** `build_stt_from_config` / `build_named_stt_provider` grew a+`dictionary_bias` keyword; `_dictation_stt` builds its primary AND every+fallback alternate with `dictionary_bias=False`. The dictation lane now sends+NO decoder prompt at all — neither the voice bias paragraph (F14) nor the+dictionary — on any provider, so there is nothing to recite. The dictionary+keeps correcting the finished transcript through `DictionaryCorrectingSTT`,+the half of the feature that cannot invent a word. The voice lane is+unchanged. The environment override is a per-machine setting and was left+in place; the history row's `metadata.stt_providers` names the recognizer+that really ran.++**Guard.** `tests/unit/dictation/test_stt_retry_and_isolation.py`+(`test_the_dictation_provider_is_built_without_the_voice_bias_prompt`+asserts `dictionary_bias=False`),+`tests/unit/plugins/stt/test_dictionary_bias_opt_out.py`.++**Related.** BUG-185 (the echo guard, which stays as the net for the voice+lane), F14 (dictation builds its own prompt-free provider), AP-21/22 (the+opt-out rides the same cross-family chain).diff --git a/jarvis/plugins/stt/__init__.py b/jarvis/plugins/stt/__init__.pyindex 717b9905e5..a92cd3238b 100644--- a/jarvis/plugins/stt/__init__.py+++ b/jarvis/plugins/stt/__init__.py@@ -491,11 +491,19 @@ def _load_provider_class(name: str) -> type | None:return None-def build_stt_from_config(stt_cfg: Any) -> Any:+def build_stt_from_config(stt_cfg: Any, *, dictionary_bias: bool = True) -> Any:"""Return an STTProvider instance for ``stt_cfg.provider``.Falls back to a local FasterWhisperProvider if the configured provider hasno entry-point or raises on construction.++ ``dictionary_bias=False`` keeps the user's STT dictionary OUT of the+ decoder prompt. The dictation lane asks for this (BUG-211): a+ prompt-capable Whisper answers a pause or a near-silent press by reciting+ the primed word list ("IDE, Agentic IDE, Agentic"), and the echo guard can+ only strip a RUN of items — a lone "IDE" reads as a word and lands in the+ document. The dictionary still applies to every transcript through the+ post-STT corrector, which is the half of the feature that cannot invent."""configured_name = (getattr(stt_cfg, "provider", "") or "").strip()# Both crossings — the on-device engine missing from THIS interpreter, and a@@ -522,13 +530,14 @@ def build_stt_from_config(stt_cfg: Any) -> Any:# still gets the dictionary's post-STT corrections — AP-21/22). The local# utterance fwhisper deliberately receives NO initial_prompt (silence-# hallucination risk, see _build_local_fallback).- try:- from jarvis.speech.stt_dictionary import dictionary_bias_words+ vocab: list[str] = []+ if dictionary_bias:+ try:+ from jarvis.speech.stt_dictionary import dictionary_bias_words- vocab = dictionary_bias_words()- except Exception as exc: # noqa: BLE001 — the dictionary must never break STT build- logger.debug("STT dictionary bias words unavailable: {}", exc)- vocab = []+ vocab = dictionary_bias_words()+ except Exception as exc: # noqa: BLE001 — the dictionary must never break STT build+ logger.debug("STT dictionary bias words unavailable: {}", exc)if vocab:joined = ", ".join(vocab)bias_prompt = f"{bias_prompt}, {joined}" if bias_prompt else joined@@ -688,7 +697,9 @@ def available_stt_provider_names() -> list[str]:return names-def build_named_stt_provider(name: str, stt_cfg: Any) -> Any:+def build_named_stt_provider(+ name: str, stt_cfg: Any, *, dictionary_bias: bool = True+) -> Any:"""Build the provider called ``name`` using ``stt_cfg`` for everything else.Language, bias prompt, dictionary vocabulary and the team-proxy handling all@@ -702,7 +713,7 @@ def build_named_stt_provider(name: str, stt_cfg: Any) -> Any:except AttributeError:# Not a pydantic model (test doubles); a tiny view is enough.patched = _StttConfigView(stt_cfg, name)- return build_stt_from_config(patched)+ return build_stt_from_config(patched, dictionary_bias=dictionary_bias)class _StttConfigView:diff --git a/jarvis/speech/pipeline.py b/jarvis/speech/pipeline.pyindex 1fe00a5ab0..8a91467659 100644--- a/jarvis/speech/pipeline.py+++ b/jarvis/speech/pipeline.py@@ -10781,7 +10781,11 @@ class SpeechPipeline:# reads as empty, which is the shipped behaviour we want anyway.own_prompt = str(getattr(dictation_cfg, "bias_prompt", "") or "").strip()patched = stt_cfg.model_copy(update={"bias_prompt": own_prompt})- instance = build_stt_from_config(patched)+ # No dictionary words in the decoder prompt either (BUG-211): a+ # prompt-capable Whisper recites the primed list over every pause+ # and a lone recited item survives the echo guard. The dictionary+ # still corrects the finished transcript — see the wrapper below.+ instance = build_stt_from_config(patched, dictionary_bias=False)except Exception as exc: # noqa: BLE001 — never lose dictation over thislog.warning("Dictation-specific STT could not be built (%s); reusing the "@@ -10804,7 +10808,9 @@ class SpeechPipeline:from jarvis.speech.stt_fallback import FallbackSTTdef _build(name: str) -> Any:- return build_named_stt_provider(name, patched)+ return build_named_stt_provider(+ name, patched, dictionary_bias=False+ )instance = FallbackSTT(instance, alternates, _build, primary_name=configureddiff --git a/tests/unit/dictation/test_stt_retry_and_isolation.py b/tests/unit/dictation/test_stt_retry_and_isolation.pyindex 17966e0351..489887f1a6 100644--- a/tests/unit/dictation/test_stt_retry_and_isolation.py+++ b/tests/unit/dictation/test_stt_retry_and_isolation.py@@ -386,8 +386,8 @@ def test_the_dictation_provider_is_built_without_the_voice_bias_prompt(seen: list[Any] = []- def _build(cfg: Any) -> Any:- seen.append(cfg)+ def _build(cfg: Any, **kwargs: Any) -> Any:+ seen.append((cfg, kwargs))return SimpleNamespace(name="built")monkeypatch.setattr(stt_plugins, "build_stt_from_config", _build)@@ -399,7 +399,11 @@ def test_the_dictation_provider_is_built_without_the_voice_bias_prompt(instance = pipe._dictation_stt()assert instance is not None- assert seen and seen[0].bias_prompt == ""+ assert seen and seen[0][0].bias_prompt == ""+ # ...and the STT dictionary stays out of the decoder prompt too (BUG-211):+ # Whisper recites a primed word list over pauses, and a lone recited item+ # passes the echo guard and lands in the document.+ assert seen[0][1] == {"dictionary_bias": False}# The VOICE config is untouched — this is a copy, not a mutation.assert pipe._config.stt.bias_prompt == "Jarvis, Adex, Ruben, Vokando"@@ -413,7 +417,7 @@ def test_the_dictation_provider_is_built_once_and_cached(monkeypatch.setattr(stt_plugins,"build_stt_from_config",- lambda cfg: builds.append(cfg) or SimpleNamespace(),+ lambda cfg, **_k: builds.append(cfg) or SimpleNamespace(),)monkeypatch.setattr(stt_plugins, "resolve_keyed_stt_fallback", lambda *_a, **_k: ())pipe = _pipeline_with_config(provider="groq-api")@@ -442,7 +446,7 @@ def test_the_dictation_provider_arms_the_cross_family_chain(from jarvis.speech.stt_fallback import FallbackSTTmonkeypatch.setattr(- stt_plugins, "build_stt_from_config", lambda cfg: SimpleNamespace()+ stt_plugins, "build_stt_from_config", lambda cfg, **_k: SimpleNamespace())monkeypatch.setattr(pipeline_mod,@@ -467,7 +471,7 @@ def test_an_unbuildable_dictation_provider_falls_back_to_the_voice_one("""A dictation with the wrong prompt beats a dictation with no provider."""import jarvis.plugins.stt as stt_plugins- def _boom(cfg: Any) -> Any:+ def _boom(cfg: Any, **_kwargs: Any) -> Any:raise RuntimeError("no entry-point")monkeypatch.setattr(stt_plugins, "build_stt_from_config", _boom)diff --git a/tests/unit/plugins/stt/test_dictionary_bias_opt_out.py b/tests/unit/plugins/stt/test_dictionary_bias_opt_out.pynew file mode 100644index 0000000000..b4b4d614ec--- /dev/null+++ b/tests/unit/plugins/stt/test_dictionary_bias_opt_out.py@@ -0,0 +1,78 @@+"""BUG-211: the STT dictionary stays out of the decoder prompt on request.++A prompt-capable Whisper recites its primed word list over a pause, and a+lone recited item passes the echo guard. The dictation lane therefore builds+its provider with ``dictionary_bias=False``; this pins that the flag really+keeps the words out of the ``prompt`` kwarg, and that the default still+merges them for the voice lane.+"""++from __future__ import annotations++from types import SimpleNamespace+from typing import Any++import pytest++import jarvis.plugins.stt as stt_plugins+import jarvis.speech.stt_dictionary as dictionary+++class _RecordingProvider:+ """Stands in for a cloud plugin; keeps the kwargs it was built with."""++ built: list[dict[str, Any]] = []++ def __init__(self, **kwargs: Any) -> None:+ type(self).built.append(kwargs)+++def _cloud_provider(monkeypatch: pytest.MonkeyPatch) -> type[_RecordingProvider]:+ _RecordingProvider.built = []+ monkeypatch.setattr(stt_plugins, "_resolve_effective_stt", lambda name: (name, ""))+ monkeypatch.setattr(stt_plugins, "_load_provider_class", lambda name: _RecordingProvider)+ monkeypatch.setattr(+ dictionary, "dictionary_bias_words", lambda *_a, **_k: ["GitHub", "Agentic IDE"]+ )+ return _RecordingProvider+++def _cfg(**overrides: Any) -> Any:+ base = {"provider": "groq-api", "language": "auto", "bias_prompt": "", "model": ""}+ base.update(overrides)+ return SimpleNamespace(**base)+++def test_the_dictionary_is_merged_into_the_prompt_by_default(+ _cloud_provider: type[_RecordingProvider],+) -> None:+ stt_plugins.build_stt_from_config(_cfg(bias_prompt="Jarvis"))++ assert _cloud_provider.built[0]["prompt"] == "Jarvis, GitHub, Agentic IDE"+++def test_the_opt_out_sends_no_prompt_when_the_dictionary_is_the_only_bias(+ _cloud_provider: type[_RecordingProvider],+) -> None:+ stt_plugins.build_stt_from_config(_cfg(), dictionary_bias=False)++ assert "prompt" not in _cloud_provider.built[0]+++def test_the_opt_out_keeps_an_explicit_bias_prompt_but_not_the_dictionary(+ _cloud_provider: type[_RecordingProvider],+) -> None:+ stt_plugins.build_stt_from_config(_cfg(bias_prompt="Jarvis"), dictionary_bias=False)++ assert _cloud_provider.built[0]["prompt"] == "Jarvis"+++def test_a_named_fallback_honours_the_opt_out_too(+ _cloud_provider: type[_RecordingProvider],+) -> None:+ """A fallback that quietly re-added the words would recite them the+ moment it took over — the chain must match the primary."""+ stt_plugins.build_named_stt_provider("openai-api", _cfg(), dictionary_bias=False)++ assert "prompt" not in _cloud_provider.built[0]