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(agentic-ide): stop a briefed terminal position from spawning a fleet

rubenluetke10-beep8fff2301e047
diff --git a/jarvis/agentic_ide/intent.py b/jarvis/agentic_ide/intent.py
index 046dc3437e..5e20f5afd3 100644
--- a/jarvis/agentic_ide/intent.py
+++ b/jarvis/agentic_ide/intent.py
@@ -39,7 +39,7 @@ from __future__ import annotations
import re
from dataclasses import dataclass
-from .names import CALL_SIGN_WORD_RE, canonical_positions, resolve
+from .names import CALL_SIGN_WORD_RE, canonical_positions, resolve, spoken_positions
# Kinds of turn this module recognises.
KIND_PROMPT = "prompt" # the user wants the agent to do something
@@ -2362,6 +2362,88 @@ def _is_agent_fleet(text: str, names: list[str] | None) -> bool:
return wants_split(text) or _AGENT_RE.search(text) is not None
+#: How close an additive must hug a number to vouch for it as a fleet size
+#: when the pane noun is elided ("noch drei", "three more"). Much tighter
+#: than ``_COUNT_AGENT_MAX_GAP`` on purpose: an additive a whole clause away
+#: is ordinary conversation, and reading it as spawn evidence would hand the
+#: veto below back the very over-reach it exists to stop.
+_ADDITIVE_NEAR_GAP = 16
+
+
+def _briefed_position_only(parse_text: str) -> bool:
+ """Whether the clause briefs a pane named BY POSITION, not sizes a fleet.
+
+ The live 2026-08-12 failure this pins: "prompt … terminal tft zwei, dass
+ es ein deep dive machen soll" — speech recognition mangled the call-sign
+ "T2" into "tft zwei", the addressing detector found no pane, and the
+ number that was the pane's NAME was then re-read here as a fleet size:
+ two fresh panes opened and were briefed while the addressed one sat idle.
+
+ Word order is what separates the two readings. A fleet size stands in
+ FRONT of the pane noun ("öffne zwei Terminals"); a position stands BEHIND
+ it ("Terminal zwei"), and ``spoken_positions`` is the one authority on
+ that shape. So when the clause carries a briefing verb and the number the
+ spawn path would read as its count — the FIRST one, which is
+ ``_spoken_count``'s contract — is part of a spoken position, it is a
+ brief for an existing pane, never a spawn, even when no pane answers to
+ that position: falling through to the ordinary brain, which can say
+ "there is no terminal two", beats opening a fleet the user never asked
+ for.
+
+ One exception keeps mixed sentences honest: a number OUTSIDE every
+ position that still reads as a fleet size of its own — fronting a pane
+ noun or a CLI name ("… und öffne noch drei Terminals"), or hugging an
+ additive when the noun is elided ("… öffne noch drei", "open three
+ more") — keeps the spawn half of such a clause alive. The additive is
+ deliberately the ONLY elision evidence: open-verb stems double as task
+ vocabulary ("mach einen Deep-Dive-Report" briefs, it does not open), so
+ a verb near the number proves nothing. A stray task word that merely
+ doubles as a number ("dass es EIN deep dive machen soll") shows none of
+ those shapes and vetoes nothing.
+ """ # i18n-allow: quoted spoken input
+ if _FLEET_BRIEF_RE.search(parse_text) is None:
+ return False
+ positions = spoken_positions(parse_text)
+ if not positions:
+ return False
+ counts = _count_tokens(parse_text)
+ if not counts:
+ return False
+
+ def _covered(c_start: int, c_end: int) -> bool:
+ return any(start <= c_start and c_end <= end for start, end, _n in positions)
+
+ if not _covered(counts[0][0], counts[0][1]):
+ return False
+ for c_start, c_end, _value in counts:
+ if _covered(c_start, c_end):
+ continue
+ ahead = parse_text[c_end : c_end + _COUNT_AGENT_MAX_GAP]
+ if _PANE_NOUN_RE.search(ahead) or _AGENT_RE.search(ahead):
+ return False
+ near_before = parse_text[max(0, c_start - _ADDITIVE_NEAR_GAP) : c_start]
+ near_after = parse_text[c_end : c_end + _ADDITIVE_NEAR_GAP]
+ if _ADDITIVE_RE.search(near_before) or _ADDITIVE_RE.search(near_after):
+ return False
+ return True
+
+
+def _mask_spoken_positions(text: str) -> str:
+ """``text`` with every spoken pane position blanked to spaces.
+
+ The count fallback in ``detect_spawn`` reads the FIRST number of the
+ clause, and a position carries a number that is a pane's NAME, not a
+ size: "öffne Terminal 2" asks for one pane, spoken while looking at the
+ grid — the open-verb sibling of the briefed shape above, and the same
+ live 2026-08-12 misreading one verb over. Blanking rather than removing
+ keeps every offset stable for the shapes parsed around it.
+ """ # i18n-allow: quoted spoken input
+ out = text
+ for start, end, _number in spoken_positions(text):
+ out = f"{out[:start]}{' ' * (end - start)}{out[end:]}"
+ return out
+
+
def detect_spawn(
user_text: str, *, names: list[str] | None = None
) -> SpawnTerminalsRequest | None:
@@ -2401,6 +2483,9 @@ def detect_spawn(
parse_text = addressed_text
+ if _briefed_position_only(parse_text):
+ return None
+
unsupported = _unsupported_clis(parse_text)
uncertain_cli = _uncertain_clis(parse_text)
@@ -2434,7 +2519,9 @@ def detect_spawn(
agent: str | None = None
if agent_match is not None:
agent = _canonical_agent(agent_match.group("agent"))
- count = _spoken_count(parse_text)
+ # A number inside a spoken position is the pane's NAME and never feeds
+ # the fallback: "öffne Terminal 2" opens ONE pane. # i18n-allow: quoted spoken input
+ count = _spoken_count(_mask_spoken_positions(parse_text))
return SpawnTerminalsRequest(
count=count,
agent=agent,
diff --git a/jarvis/agentic_ide/names.py b/jarvis/agentic_ide/names.py
index 6cf9f8ff66..4d69a689d6 100644
--- a/jarvis/agentic_ide/names.py
+++ b/jarvis/agentic_ide/names.py
@@ -260,11 +260,19 @@ _LAST_ALT = "|".join(sorted((re.escape(w) for w in _LAST_WORDS), key=len, revers
#: Order matters: the longest, most explicit shapes are tried first, so
#: "terminal number two" is read once as position 2 rather than twice.
_POSITION_PATTERNS: tuple[re.Pattern[str], ...] = (
- # "terminal 2" / "Terminal Nummer zwei" / "pane number two" / "tab dos"
+ # "terminal 2" / "Terminal Nummer zwei" / "pane number two" / "tab dos".
+ # ONE t-led consonant cluster may sit between the noun and the number: it
+ # is what is left of the spoken call-sign letter when speech recognition
+ # mangles it ("Terminal T2" arrived as "terminal tft zwei" live on
+ # 2026-08-12, and with the letter lost the pane's NAME was re-read one
+ # layer up as a fleet size — two fresh panes opened for a brief aimed at
+ # T2). Consonants only, so a real word ("Typ", "ten", "the") that happens
+ # to start with t never smuggles a number into a position.
re.compile(
rf"\b{_PANE_NOUN}\s*"
# i18n-allow: speech-recognition input vocabulary, not prose
rf"(?:(?:nummer|nr\.?|number|n[uú]mero)\s*)?"
+ rf"(?:t[bcdfghjklmnpqrstvwxz]{{0,3}}\s+)?"
rf"(?P<value>\d{{1,3}}|{_NUMBER_WORD_ALT})\b",
re.IGNORECASE,
),
@@ -291,7 +299,11 @@ _POSITION_PATTERNS: tuple[re.Pattern[str], ...] = (
# which is what happens when it is said together with the number. The
# spellings are the ones speech recognition actually produces; each is a
# non-word in all three locales, so a number word behind one is never
- # ordinary speech.
+ # ordinary speech. The BARE letter is deliberately absent: "t zwei" is
+ # also how a dictated variable or time index sounds ("t eins kleiner als
+ # t zwei"), and with no pane noun nearby nothing vouches for the pane
+ # reading. Behind the noun the same debris IS admitted — that is the
+ # cluster branch of the first pattern.
re.compile(
# i18n-allow: speech-recognition input vocabulary, not prose
rf"\b(?:tee|te|ti|tea|tey)\s*[-.]?\s*(?P<value>\d{{1,3}}|{_NUMBER_WORD_ALT})\b",
diff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.py
index 38d5f7203c..df2b1b740b 100644
--- a/jarvis/realtime/session.py
+++ b/jarvis/realtime/session.py
@@ -796,7 +796,14 @@ def _delegate_result_prompt(
Gemini's native audio deliver a line in a different (female, distorted)
voice on 2026-07-17 08:47, and BUG-086 heard the audible voice flip
gender between turns while every label still read the pinned voice.
- """
+
+ The identifier-fidelity clause is a PROMPT-ONLY mitigation: on 2026-08-12
+ the rendering swapped the result's pane names for the one the user had
+ asked about ("ich habe T2 angewiesen" over a result that opened T5/T6),
+ and nothing downstream verifies compliance. If a provider or model swap
+ resurfaces that class, the deterministic fix belongs at the readback
+ boundary, not in more prompt wording.
+ """ # i18n-allow: quoted live transcript
language_name = _LANGUAGE_NAMES.get(language, "the conversation language")
status = "success" if success else "failure"
# The injected result lives in the provider context for the REST OF THE
@@ -823,7 +830,11 @@ def _delegate_result_prompt(
f"{SPEAK_REQUEST_OPENER} "
"A trusted Jarvis action result is ready. Speak only a concise, natural "
f"rendering of the tagged result in {language_name}. {framing}Preserve "
- "its exact success or failure meaning and every material fact. Say it "
+ "its exact success or failure meaning and every material fact. Any "
+ "name or identifier the result states (a terminal, a file, a count) "
+ "must be repeated exactly as written there — never swap in a name "
+ "from the user's request that the result itself does not contain: "
+ "when they differ, that difference IS the news. Say it "
"as yourself, continuing in exactly the same voice, tone, and pace as "
"your previous replies in this conversation. Do not imitate another "
"person, do not change or dramatize your voice. Do not "
diff --git a/tests/unit/agentic_ide/test_names.py b/tests/unit/agentic_ide/test_names.py
index c7f9095c83..954b6ea923 100644
--- a/tests/unit/agentic_ide/test_names.py
+++ b/tests/unit/agentic_ide/test_names.py
@@ -70,6 +70,10 @@ class TestSpokenForms:
"prompte Terminal zwei", # i18n-allow: input vocab under test
"prompte Terminal Nummer zwei", # i18n-allow: input vocab under test
"tee zwei soll das machen", # i18n-allow: input vocab under test
+ "terminal t zwei soll das machen", # i18n-allow: input vocab under test
+ # The live 2026-08-12 transcript: "Terminal T2" mangled into a
+ # t-led consonant cluster in front of the number word.
+ "prompt wird du terminal tft zwei", # i18n-allow: input vocab under test
"das zweite Terminal soll das machen", # i18n-allow: input vocab under test
"prompt terminal two",
"the second terminal should run the tests",
@@ -128,6 +132,29 @@ class TestABareNumberNeverAddressesAPane:
assert spoken_positions("mach acht Terminals auf", count=8) == []
assert spoken_positions("öffne vier Terminals", count=4) == []
+ def test_a_real_word_is_not_a_mangled_call_sign_letter(self) -> None:
+ """The garble tolerance admits consonant debris, never vocabulary.
+
+ The cluster between the pane noun and the number exists for transcripts
+ like "terminal tft zwei" (live 2026-08-12). A real t-word in that spot
+ carries a vowel, and reading it as the letter would turn ordinary
+ speech into an address.
+ """
+ assert spoken_positions("Terminal Typ zwei", count=4) == [] # i18n-allow: input vocab
+ assert spoken_positions("terminal the two", count=4) == []
+ assert resolve("das tolle zwei", PANES) is None # i18n-allow: input vocab
+
+ def test_a_dictated_variable_is_not_a_pane(self) -> None:
+ """"t eins" / "t two" without a pane noun is a variable, not a pane.
+
+ The bare letter in front of a number word is exactly how a dictated
+ time index or variable name sounds in a coding workspace, so it never
+ addresses a pane on its own — only behind the pane noun does the same
+ debris count (the cluster branch of the noun pattern).
+ """
+ assert resolve("ob t eins kleiner ist als t zwei", PANES) is None # i18n-allow: input vocab
+ assert resolve("check if t one is less than t two", PANES) is None
+
class TestPositionsNeverMatchFuzzily:
"""T1 and T11 score 0.80 against each other — above the acting floor."""
diff --git a/tests/unit/agentic_ide/test_spawn_intent.py b/tests/unit/agentic_ide/test_spawn_intent.py
index da313ad798..418c7f5151 100644
--- a/tests/unit/agentic_ide/test_spawn_intent.py
+++ b/tests/unit/agentic_ide/test_spawn_intent.py
@@ -398,6 +398,107 @@ def test_an_addressed_terminal_still_wins_over_the_spawn_grammar() -> None:
assert intent.detect_spawn(utterance, names=NAMES) is None
+# --------------------------------------------------------------------------- #
+# Live voice regression from 2026-08-12 #
+# --------------------------------------------------------------------------- #
+
+POSITIONS = ["T1", "T2", "T3", "T4"]
+
+
+def test_a_mangled_call_sign_brief_still_reaches_its_pane() -> None:
+ """"Terminal T2" garbled to "terminal tft zwei" must not size a fleet.
+
+ The live failure: speech recognition mangled the call-sign, the addressing
+ detector found no pane, and the pane's NAME was re-read as a count — two
+ fresh panes opened and were briefed while T2 sat idle, and the voice reply
+ claimed T2 had been instructed.
+ """
+ utterance = (
+ "prompt wird du terminal tft zwei, dass es ein deep dive machen soll "
+ "und schauen soll, ob irgendwas mit unserer git historie nicht gut "
+ "ausschaut"
+ ) # i18n-allow: production transcript under test
+
+ found = intent.detect(utterance, names=POSITIONS)
+ assert found is not None
+ assert found.terminal == "T2"
+ assert found.kind == intent.KIND_PROMPT
+ assert intent.detect_spawn(utterance, names=POSITIONS) is None
+
+
+def test_a_briefed_position_never_becomes_a_fleet_size() -> None:
+ """Even with no such pane open, "prompt terminal two …" is not a spawn.
+
+ The number stands BEHIND the pane noun, which is the position shape; a
+ fleet size stands in front of it ("öffne zwei Terminals"). With the pane
+ missing, the turn falls through to the ordinary brain — which can say
+ "there is no terminal two" — rather than opening panes the user never
+ asked for.
+ """
+ utterance = (
+ "prompt wird du terminal tft zwei, dass es ein deep dive machen soll"
+ ) # i18n-allow: production transcript under test
+
+ assert intent.detect_spawn(utterance, names=["T1"]) is None
+ assert (
+ intent.detect_spawn(
+ "Prompte Terminal 2, mach einen Report", # i18n-allow: spoken input under test
+ names=["T1"],
+ )
+ is None
+ )
+
+
+def test_a_brief_beside_a_real_fleet_size_still_spawns() -> None:
+ """A clause may brief a position AND ask for panes; the spawn survives."""
+ utterance = (
+ "prompte Terminal zwei und öffne noch drei Terminals" # i18n-allow: spoken input under test
+ )
+
+ found = intent.detect_spawn(utterance, names=["T1"])
+ assert found is not None
+ assert found.count == 3
+
+
+def test_an_elided_pane_noun_still_carries_its_fleet_size() -> None:
+ """"… und öffne noch drei" keeps its three panes without repeating the noun.
+
+ Ordinary spoken continuation elides a noun the sentence already
+ established; the opener and the additive in front of the count are what
+ mark it as a fleet size rather than task vocabulary, and the veto for the
+ briefed position must not swallow it.
+ """
+ utterance = (
+ "prompte Terminal zwei und öffne noch drei" # i18n-allow: spoken input under test
+ )
+
+ found = intent.detect_spawn(utterance, names=["T1"])
+ assert found is not None
+ assert found.count == 3
+
+ trailing = intent.detect_spawn(
+ "prompt terminal two and open three more",
+ names=["T1"],
+ )
+ assert trailing is not None
+ assert trailing.count == 3
+
+
+def test_an_opened_position_is_one_pane_not_a_count() -> None:
+ """"öffne Terminal 2" opens ONE pane — the number is the pane's name.
+
+ The open-verb sibling of the briefed shape: with no pane answering to the
+ position, the count fallback used to read the position's number as a
+ fleet size and open two panes for a sentence that asked for one.
+ """
+ found = intent.detect_spawn(
+ "öffne Terminal 2", # i18n-allow: spoken input under test
+ names=["T1"],
+ )
+ assert found is not None
+ assert found.count == 1
+
+
# --------------------------------------------------------------------------- #
# Live voice regressions from 2026-07-27 #
# --------------------------------------------------------------------------- #