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): route spoken terminal spawns

rubenluetke10-beepa4554b916910
diff --git a/jarvis/agentic_ide/intent.py b/jarvis/agentic_ide/intent.py
index af04fbdd07..ba60904d48 100644
--- a/jarvis/agentic_ide/intent.py
+++ b/jarvis/agentic_ide/intent.py
@@ -1172,6 +1172,15 @@ _QUESTION_OPENER_RE = re.compile(
re.IGNORECASE,
)
+# A recombined turn can preserve the connector that introduced its latest
+# clause ("Und was passiert, wenn ...?"). Ignore only these bounded discourse
+# words when deciding whether that clause is an information question; second-
+# person requests such as "Und kannst du ...?" remain commands.
+_QUESTION_DISCOURSE_PREFIX_RE = re.compile(
+ r"^\s*¿?\s*(?:(?:und|and|y)\b[\s,;:–—-]*)+", # i18n-allow: input vocab
+ re.IGNORECASE,
+)
+
# Number words per locale. Capped at the workspace maximum: past it the count is
# clamped anyway, so spelling out "twenty" buys nothing.
_NUMBER_WORDS: dict[str, int] = {
@@ -1264,10 +1273,17 @@ def _spelling_pattern(spelling: str) -> str:
"""
tokens = spelling.split()
if len(tokens) > 1:
- return r"\s+".join(re.escape(token) for token in tokens)
+ return _SPOKEN_NAME_SEPARATOR.join(re.escape(token) for token in tokens)
return re.escape(spelling)
+# Speech providers alternate freely between whitespace and hyphens in product
+# names ("Claude Code" / "Claude-Code"). Treat both as the same spoken
+# boundary, including whitespace around a dash; punctuation outside a product
+# name remains untouched.
+_SPOKEN_NAME_SEPARATOR = r"(?:\s*[-‐‑–—]+\s*|\s+)"
+
+
#: A plural ending on a product name. People count CLIs the way they count
#: anything else — "zwei Claudes", "two Codexes" — and the name then ends in a
#: letter the word boundary after the spelling cannot cross, so the whole group
@@ -1284,12 +1300,14 @@ def _agent_alternation() -> str:
``claude``) can never shadow it.
"""
parts = [
- rf"{_spelling_pattern(spelling)}{_PLURAL_SUFFIX}(?:\s+code)?"
+ rf"{_spelling_pattern(spelling)}{_PLURAL_SUFFIX}"
+ rf"(?:{_SPOKEN_NAME_SEPARATOR}code)?"
for spellings in _agent_spellings().values()
for spelling in spellings
]
parts += [
- rf"{_spelling_pattern(spelling)}\s+{re.escape(suffix)}{_PLURAL_SUFFIX}"
+ rf"{_spelling_pattern(spelling)}{_SPOKEN_NAME_SEPARATOR}"
+ rf"{re.escape(suffix)}{_PLURAL_SUFFIX}"
for spelling, (_agent, suffix) in _agent_spellings_requiring_suffix().items()
]
return "|".join(sorted(parts, key=len, reverse=True))
@@ -1320,7 +1338,8 @@ def _canonical_agent(raw: str) -> str | None:
sentence's own verb away from the parser and drop the whole request.
"""
standalone = _standalone_spellings()
- name = " ".join(str(raw or "").casefold().split())
+ name = re.sub(r"[-‐‑–—]+", " ", str(raw or "").casefold())
+ name = " ".join(name.split())
if name in standalone:
return standalone[name]
for spelling, (agent, suffix) in _agent_spellings_requiring_suffix().items():
@@ -2361,7 +2380,15 @@ def detect_spawn(
agent_fleet = span is None and _is_agent_fleet(text, names)
if span is None and not agent_fleet:
return None
- if _QUESTION_OPENER_RE.search(text) is not None:
+ # A fast follow-up can be recombined with the previous completed turn by
+ # the voice continuation window. Judge the clause that actually requests
+ # panes, not an unrelated earlier question (live 2026-08-09: "Was geht
+ # ab? ... bitte 5 Cloth-Code-Terminal spawnen" was sent to a background
+ # worker). A real information question still starts inside ``parse_text``
+ # and remains vetoed.
+ question_scope = span.parse_text if span is not None else text
+ question_scope = _QUESTION_DISCOURSE_PREFIX_RE.sub("", question_scope)
+ if _QUESTION_OPENER_RE.search(question_scope) is not None:
return None
addressed_text = span.parse_text if span is not None else text
addressed_before_spawn = (
diff --git a/jarvis/workspace/agents.py b/jarvis/workspace/agents.py
index e4077a08e7..2c743b3ae9 100644
--- a/jarvis/workspace/agents.py
+++ b/jarvis/workspace/agents.py
@@ -526,7 +526,14 @@ _AGENTS: dict[str, WorkspaceAgent] = {
# "shift+tab" fragment.
chrome_fragments=("🌿", "tip: use"),
spoken_aliases=("claude", "cloude", "claud", "clode", "klaude", "kloude"),
- spoken_aliases_needing_suffix=("cloud", "clawed", "clod", "loud"),
+ spoken_aliases_needing_suffix=(
+ "cloud",
+ "clawed",
+ "clod",
+ "loud",
+ "cloth",
+ "glow",
+ ),
),
"codex": make_cli_agent(
"codex",
diff --git a/tests/unit/agentic_ide/test_spawn_intent.py b/tests/unit/agentic_ide/test_spawn_intent.py
index 1a6b8abe2e..da313ad798 100644
--- a/tests/unit/agentic_ide/test_spawn_intent.py
+++ b/tests/unit/agentic_ide/test_spawn_intent.py
@@ -180,6 +180,66 @@ def test_workspace_owns_a_terminal_spawn_even_though_it_names_the_vehicle() -> N
assert intent.owns_turn(background, names=NAMES) is False
+def test_recombined_completed_turn_does_not_hide_a_later_spawn_clause() -> None:
+ """A voice fast-follow must route by its command clause, not stale smalltalk.
+
+ This is the exact 2026-08-09 production text after ContinuationWindow joined
+ a completed smalltalk turn to the next Agentic-IDE command. The leading
+ ``Was`` used to trigger the information-question veto for the whole string,
+ after which force-spawn created one background worker instead of five panes.
+ """
+ utterance = (
+ "Was geht ab? Du geile Sau! Geil, kannst du bitte "
+ "5 Cloth-Code-Terminal spawnen?"
+ ) # i18n-allow: production transcript under test
+
+ found = intent.detect_spawn(utterance, names=NAMES)
+
+ assert found is not None
+ assert found.count == 5
+ assert found.groups == (intent.SpawnGroup(count=5, agent="claude"),)
+ assert found.uncertain_cli == ()
+ assert intent.owns_turn(utterance, names=NAMES) is True
+
+
+def test_question_inside_the_spawn_clause_still_never_opens_panes() -> None:
+ utterance = (
+ "Was passiert, wenn ich 5 Claude-Code-Terminals spawne?"
+ ) # i18n-allow: spoken input under test
+
+ assert intent.detect_spawn(utterance, names=NAMES) is None
+ assert intent.owns_turn(utterance, names=NAMES) is False
+
+
+def test_discourse_prefixed_question_inside_spawn_clause_never_opens_panes() -> None:
+ utterance = (
+ "Was ist die Agentic IDE? Und was passiert, wenn ich "
+ "5 Claude-Code-Terminals spawne?"
+ ) # i18n-allow: spoken input under test
+
+ assert intent.detect_spawn(utterance, names=NAMES) is None
+ assert intent.owns_turn(utterance, names=NAMES) is False
+
+
+def test_punctuated_spanish_question_inside_spawn_clause_never_opens_panes() -> None:
+ utterance = (
+ "¿Qué es el IDE? ¿Y qué pasa si abro cinco terminales "
+ "de Claude Code?"
+ ) # i18n-allow: spoken input under test
+
+ assert intent.detect_spawn(utterance, names=NAMES) is None
+ assert intent.owns_turn(utterance, names=NAMES) is False
+
+
+def test_punctuated_spanish_second_person_request_still_opens_panes() -> None:
+ utterance = "¿Y puedes abrir cinco terminales de Claude Code?" # i18n-allow
+
+ found = intent.detect_spawn(utterance, names=NAMES)
+
+ assert found is not None
+ assert found.groups == (intent.SpawnGroup(count=5, agent="claude"),)
+
+
# --------------------------------------------------------------------------- #
# Mixed fleets: "five Codex and three Claude Code terminals" #
# --------------------------------------------------------------------------- #
diff --git a/tests/unit/agentic_ide/test_spawn_misheard_agent_name.py b/tests/unit/agentic_ide/test_spawn_misheard_agent_name.py
index ff40276b38..a61ccf457f 100644
--- a/tests/unit/agentic_ide/test_spawn_misheard_agent_name.py
+++ b/tests/unit/agentic_ide/test_spawn_misheard_agent_name.py
@@ -51,7 +51,7 @@ def test_the_other_cli_is_spelled_by_ear_too(spelling: str) -> None:
assert _groups(f"open three {spelling} terminals") == [(3, "codex")]
[email protected]("spelling", ["Cloud", "Clawed", "Clod"])
[email protected]("spelling", ["Cloud", "Clawed", "Clod", "Cloth", "Glow"])
def test_an_everyday_word_counts_only_with_the_products_second_word(
spelling: str,
) -> None:
@@ -65,6 +65,18 @@ def test_an_everyday_word_counts_only_with_the_products_second_word(
assert _groups(f"open two {spelling} terminals") == [(2, None)]
+def test_live_hyphenated_cloth_code_transcript_names_claude() -> None:
+ """The exact 2026-08-09 pipeline transcript must keep its count and CLI."""
+ assert _groups(
+ "Geil, kannst du bitte 5 Cloth-Code-Terminal spawnen?"
+ ) == [(5, "claude")]
+
+
[email protected]("separator", [" - ", "- ", " – "])
+def test_spaced_product_name_dashes_still_name_claude(separator: str) -> None:
+ assert _groups(f"open two Cloth{separator}Code terminals") == [(2, "claude")]
+
+
def test_the_misspelling_survives_the_other_locales() -> None:
"""Spanish and German utterances go through the same table, not a copy."""
german = "öffne zwei neue Kodex Terminals und drei Cloude Code Terminals" # i18n-allow
diff --git a/tests/unit/brain/test_agentic_ide_spawn_fast_path.py b/tests/unit/brain/test_agentic_ide_spawn_fast_path.py
index 82ddd61477..add2e3a1a1 100644
--- a/tests/unit/brain/test_agentic_ide_spawn_fast_path.py
+++ b/tests/unit/brain/test_agentic_ide_spawn_fast_path.py
@@ -156,6 +156,26 @@ async def test_a_named_agent_is_honoured_over_the_inherited_one(
assert [t.agent for t in registry.session.terminals] == ["codex", "claude", "claude"]
+async def test_live_recombined_pipeline_turn_opens_five_claude_panes(
+ manager: tuple[BrainManager, FakeBus], registry: Registry, tmp_path: Path
+) -> None:
+ """The production failure must stop before the background-worker route."""
+ mgr, bus = manager
+ await _open(registry, tmp_path, 3, agent="claude")
+ utterance = (
+ "Was geht ab? Du geile Sau! Geil, kannst du bitte "
+ "5 Cloth-Code-Terminal spawnen?"
+ ) # i18n-allow: production transcript under test
+
+ reply = await mgr._run_agentic_ide_spawn_fast_path(utterance)
+
+ assert reply is not None
+ assert registry.session is not None
+ assert len(registry.session.terminals) == 8
+ assert {term.agent for term in registry.session.terminals[3:]} == {"claude"}
+ assert _event_names(bus) == ["AgenticIdeTerminalsAdded", "NavigateSidebar"]
+
+
async def test_spawn_and_prompt_queues_exactly_the_new_codex_fleet(
manager: tuple[BrainManager, FakeBus],
registry: Registry,