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): a CLI name past a group boundary vouches for nothing

rubenluetke10-beepa0857884ba6a
diff --git a/jarvis/agentic_ide/intent.py b/jarvis/agentic_ide/intent.py
index 8fb0786cac..ccd692031f 100644
--- a/jarvis/agentic_ide/intent.py
+++ b/jarvis/agentic_ide/intent.py
@@ -1942,6 +1942,25 @@ def _closest_clis(word: str) -> tuple[tuple[str, float], ...]:
return tuple(sorted(scored, key=lambda item: (-item[1], item[0])))
+#: Punctuation or coordination that ends one fleet group and starts the next.
+_GROUP_BOUNDARY_RE = re.compile(
+ r"[,;]|\b(?:und|and|y)\b", # i18n-allow: input vocab
+ re.IGNORECASE,
+)
+
+
+def _group_boundary_between(gap: str) -> bool:
+ """Whether ``gap`` separates two fleet groups rather than two of one name.
+
+ A comma, a coordination, or a fresh count each start a group of their own,
+ so a CLI name on the far side of one cannot vouch for the word on the near
+ side.
+ """
+ if _GROUP_BOUNDARY_RE.search(gap):
+ return True
+ return any(_count_of(token) is not None for token in _COUNT_TOKEN_RE.findall(gap))
+
+
def _uncertain_clis(text: str) -> tuple[UncertainCli, ...]:
"""Words standing where a CLI name belongs that name none of them clearly.
@@ -1991,8 +2010,19 @@ def _uncertain_clis(text: str) -> tuple[UncertainCli, ...]:
if not behind_count and not before_pane:
continue
# The real name may follow it ("two NASA Cloud Code terminals"): the
- # group is not in doubt, so neither is this word.
- if any(0 <= start - match.end() <= 12 for start, _end in known):
+ # group is not in doubt, so neither is this word. But only WITHIN the
+ # group — a comma, a coordination or a fresh count between them means
+ # the name belongs to the NEXT group, and vouches for nothing here:
+ # "two closed, one codex" garbles "Claudes" into "closed", and the
+ # codex behind the comma was read as this group's real name, so two
+ # panes of whatever kind happened to be inherited opened in silence
+ # instead of the question the garble deserves (maintainer report
+ # 2026-08-12).
+ if any(
+ 0 <= start - match.end() <= 12
+ and not _group_boundary_between(text[match.end() : start])
+ for start, _end in known
+ ):
continue
candidates = _closest_clis(word)
if not candidates:
diff --git a/tests/unit/agentic_ide/test_spawn_intent.py b/tests/unit/agentic_ide/test_spawn_intent.py
index 3d8e63a85b..4050411f93 100644
--- a/tests/unit/agentic_ide/test_spawn_intent.py
+++ b/tests/unit/agentic_ide/test_spawn_intent.py
@@ -946,6 +946,32 @@ def test_prompt_them_does_not_leak_the_pronoun_into_the_task() -> None:
assert intent.distributes_tasks(instruction) is True
+def test_a_garble_before_the_next_group_still_earns_the_question() -> None:
+ """"two closed, one codex" garbles "Claudes" — Jarvis must ask, not guess.
+
+ The old guard saw the codex six characters behind "closed" and treated it
+ as this group's real name — but it stands past a comma, in a group of its
+ own, so two panes of whatever kind happened to be inherited opened in
+ silence. A name only vouches for debris INSIDE its own group ("two NASA
+ Cloud Code terminals"), never across a boundary.
+ """
+ found = intent.detect_spawn(
+ "spawn two closed, one codex and one open code terminal", names=NAMES
+ )
+ assert found is not None
+ assert len(found.uncertain_cli) == 1
+ assert found.uncertain_cli[0].spoken == "closed"
+ assert "Claude Code" in found.uncertain_cli[0].candidates
+
+ # Within one group the real name still vouches for the debris word.
+ inside = intent.detect_spawn(
+ "Open two NASA Cloud Code terminals and one Codex terminal", names=NAMES
+ )
+ assert inside is not None
+ assert inside.uncertain_cli == ()
+ assert [(g.count, g.agent) for g in inside.groups] == [(2, "claude"), (1, "codex")]
+
+
def test_spoken_filler_in_front_of_the_enumeration_is_not_the_task() -> None:
""""prompt them LIKE one fixes …" — the filler must not hide the division.