Skip to content

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.

fix(dictation): a recited Whisper prompt is dropped from raw_text on its own, and from the middle of a transcript

rubenluetke10-beepf78107c450ff
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f3007eccc..aa1630e614 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,15 @@ versioning per [SemVer](https://semver.org/).
### Added
+- **Agentic IDE chat: every connected coding CLI is a seat.** The chat's
+ provider picker lists the Agentic IDE's own CLI registry under "Coding
+ CLIs" — OpenCode, Kimi Code, GLM Coding Plan and DeepSeek Harness join
+ Claude Code, Codex, Grok Build and Antigravity — instead of the sub-agent
+ missions' provider map, and each one answers as a chat: the reply, the
+ reasoning where the CLI shares it, and every tool call with its result as
+ rows in the conversation, never as a terminal. OpenCode's model list comes
+ live from `opencode models`; a CLI that keeps its own login reads as
+ available once it is installed; a CLI the registry drops leaves the picker.
- **Local models: one click sets everything up.** "Set up everything" on the
overview starts the local server when it is stopped (and names the install
on the button when it is not installed), then fills every role — chat,
@@ -65,6 +74,31 @@ versioning per [SemVer](https://semver.org/).
### Fixed
+- **Spend: the coding-CLI bill no longer shrinks, and it counts every
+ subagent.** Three things made the Spend section show less than was spent
+ — $8 000 for a month that had read $12 300 the day before. The index of
+ the coding CLIs' transcripts deleted a session's turns when the CLI
+ deleted its log (Claude Code does after `cleanupPeriodDays`), so the
+ lifetime total sank a little every night; a change to a reader's rule
+ dropped the whole index and rebuilt it from zero, and for the hours that
+ took the page presented the half-read index as the bill — two views a
+ minute apart disagreed by thousands; and the transcripts of every
+ subagent (`<session>/subagents/**`, the Agent tool and workflows) were
+ never read at all — one fifth of every Claude Code call on the reference
+ machine. The index is now a ledger: a vanished transcript keeps its rows,
+ a rule change re-reads the transcripts still on disk and corrects rows in
+ place while the table stays complete, subagent transcripts are indexed
+ under the conversation that spawned them, and while the index is still
+ catching up the section says so — "{n} of {m} transcripts read, {x} MB to
+ go" — and reads again every few seconds instead of once a minute.
+ (BUG-198)
+- **Dictation: "Agentic IDE, Agentic IDE, Agentic IDE" no longer lands in the
+ text — from the middle of a dictation either.** Whisper recites the
+ dictionary's bias prompt over a pause and then carries on with the speech
+ that followed, and the field dictation pastes from was checked only by what
+ the provider's filtered copy had lost. Each copy is now judged on its own,
+ and a recited run is dropped wherever it stands; three distinct terms in one
+ breath stay.
- **Local models: a changed role showed its old pick for up to 15 s.** The
overview's in-memory memo was not dropped on a write, and the section never
asked for a live rebuild after its own change. Every write now forgets the
diff --git a/docs/BUGS.md b/docs/BUGS.md
index f7c357c99a..9e615581a7 100644
--- a/docs/BUGS.md
+++ b/docs/BUGS.md
@@ -13147,10 +13147,45 @@ and five sentences ending in dictionary words that must survive),
`::test_fuzzy_long_tokens_allow_one_sound_apart`,
`::test_fuzzy_never_rewrites_toward_a_misspelt_entry`.
+**Second landing (2026-08-27, FIXED the same day).** The day after the tail
+guard shipped, two dictations carried the recitation again: 09:33 UTC
+`… da oben. IDE, Agentic IDE, Agentic IDE, Agentic IDE, Agentic Also ich kann …` <!-- i18n-allow: verbatim transcript -->
+and 16:38 UTC
+`… zu verhandeln. Agentic IDE, Agentic IDE, Agentic IDE, Agentic IDE, Agentic IDE` <!-- i18n-allow: verbatim transcript -->
+— two gaps, both in the guard's reach, not in its rule:
+
+1. **The wrapper judged `raw_text` only by what `text` had lost.** Groq's
+ provider filters `text` on the way in (`transcript_filter.clean_stt_text`
+ folds a phrase repeated three or more times into one), so `text` ended in a
+ single "Agentic IDE" — one term at the end of a sentence, which the guard
+ rightly keeps. `raw_text` was stripped only when `text` had changed, and
+ the dictation lane transcribes from `raw_text`, where all five copies still
+ stood (`jarvis_desktop.log` 18:38:47–58: the truncation repair's two halves
+ came back, and the only strip logged was the last window's own
+ "Agentic IDE, Agentic"). Each field is now judged on its own.
+2. **The guard looked at the tail only.** Whisper recites over a pause
+ *inside* a window and then transcribes the speech that followed it, so the
+ run stands in the middle of the text with real words on both sides.
+ `strip_prompt_echo` now walks every run of two or more dictionary items
+ and drops a mid-text run when it repeats an item or holds four
+ (`_ECHO_MIN_MID_ITEMS`); three distinct terms in one breath
+ ("Claude, Agentic IDE, Grok are the three sections") stay. A sentence mark
+ right after a dropped run moves to the words before it, and the
+ one-code-point ellipsis Whisper likes to end a hallucination with counts as
+ closing the text, like the three-dot kind.
+
+Guard: `TestPromptEcho::test_recitation_over_a_pause_is_dropped_from_the_middle`,
+`::test_a_recited_whole_list_in_the_middle_is_dropped`,
+`::test_three_distinct_terms_in_a_sentence_stay`,
+`::test_a_sentence_mark_after_a_mid_run_moves_to_the_words_before`,
+`::test_an_ellipsis_still_closes_the_tail`, `::test_two_runs_are_both_dropped`,
+`TestWrapper::test_raw_text_is_stripped_even_when_the_filtered_text_passed`.
+
**Lesson.** A decoder bias is text the model will happily read back to you;
whatever goes into a Whisper prompt needs a guard on the way out. And "one
letter apart" is a property of spelling — the person who registers a word is
-describing how it sounds.
+describing how it sounds. When a provider carries two copies of its answer,
+a guard that reads one and infers the other has guarded neither.
## BUG-186: "There you go, I've just started some cool music on YouTube Music" — over a silent machine. The tool pressed a media key blindly, called that a resume, and the voice sold it as done (HIGH, FIXED 2026-08-26)
diff --git a/jarvis/speech/stt_dictionary.py b/jarvis/speech/stt_dictionary.py
index 437185b9d3..951fb7111c 100644
--- a/jarvis/speech/stt_dictionary.py
+++ b/jarvis/speech/stt_dictionary.py
@@ -14,7 +14,13 @@ Dictation-tool-style feature: the user registers words the STT keeps getting wro
The canonical words are also handed to prompt-capable Whisper providers as a
decoder bias, and Whisper answers silence by reciting that list back
("…, Claude, Agentic IDE, Claude, Agentic"). The provider wrapper drops such a
-run from the end of a transcript before correcting it (BUG-185).
+run from a transcript before correcting it (BUG-185) — from its end, and from
+its middle too, because Whisper recites over a pause and then carries on with
+the speech that followed it. The wrapper strips ``raw_text`` on its own, not
+only when ``text`` lost something: the provider's cleanup has already folded a
+fivefold "Agentic IDE" on ``text`` into one, which passes for a sentence, while
+the dictation lane transcribes from ``raw_text``, where all five still stand
+(BUG-185, second landing 2026-08-27).
Design constraints (see the plan file and CLAUDE.md):
@@ -95,12 +101,25 @@ _FOLD_RULES: tuple[tuple[str, str], ...] = (
_FOLD_SILENT_H_RE = re.compile(r"(?<!^)h")
_FOLD_REPEAT_RE = re.compile(r"(.)\1+")
-# Prompt-echo guard. A run of dictionary items at the END of a transcript is
-# Whisper reciting its bias prompt, never speech, when it is long enough or
-# repeats itself; a whole transcript made of nothing else needs fewer items,
-# because a stretch of silence is exactly where the recitation happens.
+# Prompt-echo guard. A run of dictionary items is Whisper reciting its bias
+# prompt, never speech, when it is long enough or repeats itself. Where the run
+# stands decides how much it takes: a whole transcript made of nothing else
+# needs the fewest items, because a stretch of silence is exactly where the
+# recitation happens; the END of a transcript is the next most likely place
+# (the silence after the last word); a run in the MIDDLE — Whisper reciting
+# over a pause and then transcribing the speech that followed — needs a repeat
+# or a run longer than any sentence lists dictionary terms in a row.
_ECHO_MIN_TAIL_ITEMS = 3
_ECHO_MIN_WHOLE_ITEMS = 2
+_ECHO_MIN_MID_ITEMS = 4
+
+#: Characters that may follow a run without it being "followed by speech":
+#: the recognizer's own punctuation, including the ellipsis it likes to end a
+#: hallucination with (one code point, not three dots) and a dangling dash.
+_ECHO_TRAIL_CHARS = " \t\r\n,.;:!?\u2026-\u2013\u2014"
+_ECHO_LEAD_SEP_RE = re.compile(r"^[\s,;:]+")
+_ECHO_TERMINATOR_RE = re.compile(r"^[.!?\u2026]+")
+_SENTENCE_END_CHARS = ".!?\u2026:"
# Re-stat the sidecar at most this often — the corrector is consulted per
# STT call (including the live-preview probe at a few calls/second).
@@ -380,10 +399,12 @@ def _compile_echo_patterns(
) -> tuple[re.Pattern[str] | None, re.Pattern[str] | None]:
"""Patterns behind :meth:`TranscriptCorrector.strip_prompt_echo`.
- ``tail`` matches a run of dictionary items that closes the text —
- whole entries, plus the single tokens of multi-word entries, because a
- recitation may start mid-phrase ("IDE, Agentic IDE, …"). ``item`` finds
- the WHOLE entries inside such a run; fragments never count as items.
+ ``run`` matches a run of two or more dictionary items anywhere in the
+ text — whole entries, plus the single tokens of multi-word entries,
+ because a recitation may start mid-phrase ("IDE, Agentic IDE, …").
+ ``item`` finds the WHOLE entries inside such a run; fragments never count
+ as items. Where the run stands (whole, tail, middle) is the caller's
+ reading of what surrounds the match.
"""
phrases = sorted({e.word for e in entries}, key=len, reverse=True)
if not phrases:
@@ -404,13 +425,33 @@ def _compile_echo_patterns(
item_alt = "|".join(whole)
run_alt = "|".join(whole + [re.escape(f) for f in fragments])
separator = r"(?:\s*[,;:]\s*|\s*\.\s+|\s+)"
- tail = re.compile(
- rf"(?<!\w)(?P<run>(?:{run_alt})(?:{separator}(?:{run_alt}))+)(?!\w)"
- r"[\s,.;:!?]*$",
+ run = re.compile(
+ rf"(?<!\w)(?P<run>(?:{run_alt})(?:{separator}(?:{run_alt}))+)(?!\w)",
re.IGNORECASE | re.UNICODE,
)
item = re.compile(rf"(?<!\w)(?:{item_alt})(?!\w)", re.IGNORECASE | re.UNICODE)
- return tail, item
+ return run, item
+
+
+def _splice_out_run(before: str, after: str) -> str:
+ """``before`` and ``after`` rejoined as if the run between them was never
+ said. A separator the run dragged along goes with it; a sentence mark
+ right after the run belonged to the words before it, so it moves there
+ unless those already end a sentence — "and then Agentic IDE, Agentic
+ IDE. That was" reads "and then. That was", never "and then . That was".
+ """
+ left = before.rstrip()
+ right = _ECHO_LEAD_SEP_RE.sub("", after)
+ mark = _ECHO_TERMINATOR_RE.match(right)
+ if mark is not None:
+ right = right[mark.end() :].lstrip()
+ if left and left[-1] not in _SENTENCE_END_CHARS:
+ left = left.rstrip(",;:") + mark.group(0)
+ if not left:
+ return right
+ if not right:
+ return left
+ return f"{left} {right}"
class TranscriptCorrector:
@@ -450,36 +491,61 @@ class TranscriptCorrector:
self._fuzzy_index.setdefault(fold[:1], []).append((word, fold))
self._token_re = re.compile(r"[^\W\d_][\w''\-]*", re.UNICODE)
- self._echo_tail_re, self._echo_item_re = _compile_echo_patterns(entries)
+ self._echo_run_re, self._echo_item_re = _compile_echo_patterns(entries)
self.rule_count = len(self._replacements) + len(self._casing)
def strip_prompt_echo(self, text: str) -> str:
- """Drop a recited bias prompt from the end of ``text``.
+ """Drop a recited bias prompt from ``text``, wherever it stands.
Prompt-capable Whisper providers receive the canonical words as a
comma-separated decoder bias, and Whisper answers a stretch of silence
by continuing that list — "…, Claude, Agentic IDE, Claude, Agentic".
- A run of dictionary items closing the transcript is that recitation
- when it holds at least ``_ECHO_MIN_TAIL_ITEMS`` items or repeats one;
- a transcript made of nothing else needs ``_ECHO_MIN_WHOLE_ITEMS``.
- One trailing word, or two different ones, is a sentence and stays:
- "…nutze Claude, Agentic IDE." is something a person says.
+ A run of dictionary items is that recitation when it repeats an item,
+ or when it is longer than a sentence has reason to be: at least
+ ``_ECHO_MIN_TAIL_ITEMS`` items when the run closes the transcript, and
+ ``_ECHO_MIN_WHOLE_ITEMS`` when the transcript holds nothing else.
+
+ The silence Whisper recites over is not only the one after the last
+ word. A pause mid-dictation lands the run in the MIDDLE of a window,
+ with the speech that followed the pause transcribed right after it
+ ("… up there. IDE, Agentic IDE, Agentic IDE, Agentic IDE, Agentic So
+ I cannot …"). A run there is dropped when it repeats an item or holds
+ ``_ECHO_MIN_MID_ITEMS`` — a person may list three of their terms in
+ one breath; the fourth, or the same one twice, is the prompt.
+
+ One word, or two different ones, is a sentence and stays wherever it
+ is: "…I use Claude, Agentic IDE." and "the Agentic IDE amounts" are
+ things a person says.
"""
- if not text or self._echo_tail_re is None or self._echo_item_re is None:
- return text
- match = self._echo_tail_re.search(text)
- if match is None:
+ if not text or self._echo_run_re is None or self._echo_item_re is None:
return text
- run = match.group("run")
- items = [
- " ".join(m.group(0).casefold().split())
- for m in self._echo_item_re.finditer(run)
- ]
- whole = match.start("run") == 0 or not text[: match.start("run")].strip()
- needed = _ECHO_MIN_WHOLE_ITEMS if whole else _ECHO_MIN_TAIL_ITEMS
- if len(items) < needed and len(items) == len(set(items)):
+ matches = list(self._echo_run_re.finditer(text))
+ if not matches:
return text
- return text[: match.start("run")].rstrip()
+ out = text
+ # Back to front: a removal only ever shortens what FOLLOWS the earlier
+ # matches, so their offsets into ``out`` stay valid — and a run that
+ # becomes the tail once the run after it is gone is judged as one.
+ for match in reversed(matches):
+ run = match.group("run")
+ items = [
+ " ".join(m.group(0).casefold().split())
+ for m in self._echo_item_re.finditer(run)
+ ]
+ before = out[: match.start("run")]
+ after = out[match.end("run") :]
+ closes = not after.strip(_ECHO_TRAIL_CHARS)
+ whole = closes and not before.strip()
+ if whole:
+ needed = _ECHO_MIN_WHOLE_ITEMS
+ elif closes:
+ needed = _ECHO_MIN_TAIL_ITEMS
+ else:
+ needed = _ECHO_MIN_MID_ITEMS
+ if len(items) < needed and len(items) == len(set(items)):
+ continue
+ out = before.rstrip() if closes else _splice_out_run(before, after)
+ return out
def correct(self, text: str) -> str:
if not text or self.rule_count == 0:
@@ -643,19 +709,19 @@ class DictionaryCorrectingSTT:
# are words a person registered by name — so they have to reach both
# fields or dictation silently stops honouring the dictionary.
raw = getattr(transcript, "raw_text", "") or ""
- # A finished transcript that ends in a recited bias prompt loses
- # that tail BEFORE correction. Partials are still growing — an
+ # A finished transcript that carries a recited bias prompt loses
+ # it BEFORE correction. Partials are still growing — an
# enumeration cut off mid-list is not evidence of anything.
+ # ``raw_text`` is judged on its own, never on what ``text`` lost:
+ # the provider's cleanup folds a repeated phrase on ``text`` into
+ # one ("Agentic IDE" ×5 → "Agentic IDE"), which passes for a
+ # sentence, while ``raw_text`` — the field dictation transcribes
+ # from — still holds every copy. Stripping raw only after text had
+ # lost something is how five "Agentic IDE" reached a document
+ # the day after the tail guard shipped.
if not getattr(transcript, "is_partial", False):
- kept = corrector.strip_prompt_echo(text)
- if kept != text:
- log.info(
- "STT dictionary dropped a recited bias prompt from the "
- "transcript tail: %r",
- text[len(kept) :].strip(),
- )
- text = kept
- raw = corrector.strip_prompt_echo(raw) if raw else raw
+ text = self._strip_echo(corrector, text, "text")
+ raw = self._strip_echo(corrector, raw, "raw_text") if raw else raw
corrected = corrector.correct(text)
corrected_raw = corrector.correct(raw) if raw else raw
original_text = getattr(transcript, "text", "")
@@ -677,6 +743,19 @@ class DictionaryCorrectingSTT:
log.warning("STT dictionary correction failed (%s); using raw text.", exc)
return transcript
+ @staticmethod
+ def _strip_echo(corrector: TranscriptCorrector, value: str, field: str) -> str:
+ """``value`` without a recited bias prompt, logged when one was there."""
+ kept = corrector.strip_prompt_echo(value)
+ if kept != value:
+ log.info(
+ "STT dictionary dropped a recited bias prompt from %s: %r -> %r",
+ field,
+ value[-120:],
+ kept[-120:],
+ )
+ return kept
+
async def transcribe_pcm(self, *args: Any, **kwargs: Any) -> Any:
return self._apply(await self._inner.transcribe_pcm(*args, **kwargs))
diff --git a/tests/unit/speech/test_stt_dictionary.py b/tests/unit/speech/test_stt_dictionary.py
index e13b060e1d..f65141a42b 100644
--- a/tests/unit/speech/test_stt_dictionary.py
+++ b/tests/unit/speech/test_stt_dictionary.py
@@ -274,6 +274,67 @@ class TestPromptEcho:
"Claude, Agentic IDE, Claude"
)
+ def test_recitation_over_a_pause_is_dropped_from_the_middle(self) -> None:
+ # Verbatim from dictation history 2026-08-27 09:33 UTC: Whisper recited
+ # over a pause inside the window and then transcribed the speech that
+ # followed it, so the run stood mid-text and the tail guard never saw it.
+ c = _live_corrector()
+ heard = (
+ "Aber egal, es geht um diese Sections da oben. IDE, Agentic IDE, "
+ "Agentic IDE, Agentic IDE, Agentic Also ich kann mir nicht mal die " # i18n-allow: verbatim transcript
+ "Chats anzeigen lassen." # i18n-allow: verbatim transcript
+ )
+ assert c.strip_prompt_echo(heard) == (
+ "Aber egal, es geht um diese Sections da oben. Also ich kann mir " # i18n-allow: verbatim transcript
+ "nicht mal die Chats anzeigen lassen." # i18n-allow: verbatim transcript
+ )
+
+ def test_a_recited_whole_list_in_the_middle_is_dropped(self) -> None:
+ # No item repeats, but nobody lists four of their own terms in a row.
+ c = _live_corrector()
+ heard = "then GitHub, Grok, Claude, Agentic IDE, Agentic and so on"
+ assert c.strip_prompt_echo(heard) == "then and so on"
+
+ def test_three_distinct_terms_in_a_sentence_stay(self) -> None:
+ c = _live_corrector()
+ for sentence in (
+ "Claude, Agentic IDE, Grok are the three sections.",
+ "bei den Agentic IDE Beträgen gibt es Fehler", # i18n-allow: verbatim transcript
+ "open GitHub, Claude and Grok, then close them.",
+ ):
+ assert c.strip_prompt_echo(sentence) == sentence
+
+ def test_a_sentence_mark_after_a_mid_run_moves_to_the_words_before(
+ self,
+ ) -> None:
+ c = _live_corrector()
+ heard = "und dann Agentic IDE, Agentic IDE. Das war so." # i18n-allow: verbatim transcript
+ assert c.strip_prompt_echo(heard) == "und dann. Das war so." # i18n-allow: verbatim transcript
+ # …but never doubles one the words before already carry.
+ assert c.strip_prompt_echo(
+ "Also. IDE, Agentic IDE, Agentic IDE, Agentic IDE, ebenso funktionieren."
+ ) == "Also. ebenso funktionieren."
+
+ def test_an_ellipsis_still_closes_the_tail(self) -> None:
+ # Whisper ends a hallucination with the one-code-point ellipsis as
+ # readily as with three dots; either is the recognizer's, not speech.
+ c = _live_corrector()
+ spoken = "verhandeln."
+ for trail in ("\u2026", "...", " -", "\n"):
+ heard = spoken + " Agentic IDE, Agentic IDE, Agentic IDE" + trail
+ assert c.strip_prompt_echo(heard) == spoken
+
+ def test_two_runs_are_both_dropped(self) -> None:
+ # Verbatim shape from 2026-08-26 17:53 UTC: one recitation over a pause
+ # in the middle and one over the silence at the end.
+ c = _live_corrector()
+ heard = (
+ "Also. IDE, Agentic IDE, Agentic IDE, Agentic IDE, Agentic IDE, "
+ "ebenso funktionieren. Nur bei dem IDE, Agentic IDE, Agentic IDE, " # i18n-allow: verbatim transcript
+ "Agentic IDE"
+ )
+ assert c.strip_prompt_echo(heard) == "Also. ebenso funktionieren. Nur bei dem" # i18n-allow: verbatim transcript
+
# ----------------------------------------------------------------------
# Live-reloading shared corrector + bias words
@@ -314,6 +375,29 @@ class _FakeTranscript:
segments: tuple = field(default_factory=tuple)
+@dataclass
+class _FakeRawTranscript:
+ text: str
+ raw_text: str
+ language: str = "de"
+ confidence: float = 0.9
+ is_partial: bool = False
+ segments: tuple = field(default_factory=tuple)
+
+
+class _FakeRawSTT:
+ """A provider that, like Groq, carries the unfiltered string on ``raw_text``."""
+
+ def __init__(self, *, text: str, raw_text: str) -> None:
+ self.text = text
+ self.raw_text = raw_text
+
+ async def transcribe_pcm(
+ self, pcm: bytes, sample_rate: int = 16_000, **kwargs: Any
+ ) -> _FakeRawTranscript:
+ return _FakeRawTranscript(text=self.text, raw_text=self.raw_text)
+
+
class _FakeSTT:
"""Duck-typed STT provider fake (tests/fakes convention, no mock lib)."""
@@ -379,6 +463,25 @@ class TestWrapper:
result = await wrapped.transcribe_pcm(b"\x00\x00")
assert result.text == "open GitHub."
+ async def test_raw_text_is_stripped_even_when_the_filtered_text_passed(
+ self, store: DictionaryStore, monkeypatch: pytest.MonkeyPatch
+ ) -> None:
+ # The second landing of BUG-185 (2026-08-27 16:38 UTC): the provider's
+ # own cleanup had folded "Agentic IDE" ×5 on ``text`` into one, which
+ # reads as a sentence — and the dictation lane transcribes from
+ # ``raw_text``, where all five still stood. Each field is judged alone.
+ monkeypatch.setattr(sd, "_RELOAD_CHECK_INTERVAL_S", 0.0)
+ store.add("Agentic IDE")
+ spoken = "Idee, das ganze Pult ausführlich zu verhandeln." # i18n-allow: verbatim transcript
+ recited = " Agentic IDE, Agentic IDE, Agentic IDE, Agentic IDE, Agentic IDE"
+ wrapped = DictionaryCorrectingSTT(
+ _FakeRawSTT(text=spoken + " Agentic IDE", raw_text=spoken + recited),
+ store=store,
+ )
+ result = await wrapped.transcribe_pcm(b"\x00\x00")
+ assert result.raw_text == spoken
+ assert result.text == spoken + " Agentic IDE" # one term is a sentence
+
async def test_partial_transcripts_keep_their_tail(
self, store: DictionaryStore, monkeypatch: pytest.MonkeyPatch
) -> None: