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(spawn): a spoken confirmation that names the vehicle is not too long
rubenluetke10-beepbc4f2292074e
diff --git a/jarvis/brain/spawn_gate.py b/jarvis/brain/spawn_gate.pyindex 9158655e11..533ec6022e 100644--- a/jarvis/brain/spawn_gate.py+++ b/jarvis/brain/spawn_gate.py@@ -116,6 +116,25 @@ def _marker_spans(text: str) -> list[tuple[int, int]]:# realtime answer pull-back (``_DELEGATE_ANSWER_MAX_TOKENS``)._CONFIRM_MAX_WORDS = 6+# …unless the confirmation NAMES the vehicle, which is evidence the six-word+# cap is only guessing at. The counter-example above is dangerous precisely+# because it confirms and then changes the subject; "just do the sub and then+# do it" confirms and points back at the very thing that was offered. Live+# 2026-08-24 10:24 Turn 5: the user's third request in a row, read as a+# confirm by every classifier, refused on length alone (eight words). Spoken+# turns carry filler ("just", "and then") that written ones do not, so the+# cap has to be generous once the vehicle is on the record.+_CONFIRM_MAX_WORDS_NAMING_VEHICLE = 14++# The clipped form of the vehicle, which the marker pattern deliberately does+# NOT carry: ``_DELEGATION_MARKER_RE`` is shared with the Agentic-IDE turn+# detector (``names_spawn_vehicle``), where a bare "sub" would start stealing+# turns from a workspace pane. Inside an ARMED offer window there is no such+# ambiguity — the subject under discussion is the offered agent — so the+# short form is honoured only here. Word-bounded so "subscribe", "submit",+# "subject" and "substitute" stay untouched.+_SHORT_VEHICLE_RE: re.Pattern[str] = re.compile(r"\bsubs?\b", re.IGNORECASE)+# An offer is only fresh for the immediate follow-up exchange. Voice turns# arrive within seconds; two minutes comfortably covers a slow "hmm... yes"# without letting a stale offer unlock a spawn much later in the session.@@ -188,7 +207,9 @@ class DelegationOfferWindow:The turn that armed the window can never confirm itself, a longsentence never confirms, and any veto wording closes the window for- good (declined offers must not linger as an unlockable spawn).+ good (declined offers must not linger as an unlockable spawn). A+ confirmation that names the vehicle gets the longer cap — see+ ``_CONFIRM_MAX_WORDS_NAMING_VEHICLE``."""if not self._armed_text:return False@@ -202,7 +223,9 @@ class DelegationOfferWindow:if "veto" in verdicts:self.disarm()return False- if len(norm.split()) > _CONFIRM_MAX_WORDS:+ names_vehicle = bool(_marker_spans(norm)) or bool(_SHORT_VEHICLE_RE.search(norm))+ cap = _CONFIRM_MAX_WORDS_NAMING_VEHICLE if names_vehicle else _CONFIRM_MAX_WORDS+ if len(norm.split()) > cap:return Falseif "confirm" in verdicts:self.disarm()diff --git a/tests/unit/brain/test_spawn_gate.py b/tests/unit/brain/test_spawn_gate.pyindex 6f0f31f2e1..fc3bb7a4be 100644--- a/tests/unit/brain/test_spawn_gate.py+++ b/tests/unit/brain/test_spawn_gate.py@@ -167,6 +167,37 @@ def test_long_sentence_containing_yes_does_not_unlock() -> None:)+def test_spoken_confirm_naming_the_vehicle_unlocks_past_the_word_cap() -> None:+ """Live 2026-08-24 10:24 Turn 5 — the user's third ask in a row.++ Every classifier read "just follow the sub and then do it" as a confirm;+ it was refused on length alone (eight words against a six-word cap).+ Naming the vehicle — here the clipped "sub" — is the evidence the cap is+ otherwise only guessing at, so the confirmation stands.+ """+ assert llm_spawn_allowed("Give me an overview of my calendar and mails.") is False+ assert llm_spawn_allowed("Just follow the sub and then do it.") is True+++def test_longer_cap_needs_the_vehicle_not_merely_length() -> None:+ """The counter-example the cap exists for must stay blocked.++ It confirms and then changes the subject; the Turn-5 shape confirms and+ points back at what was offered. Only the second one gets the long cap.+ """+ assert llm_spawn_allowed("Where should I move next?") is False+ assert llm_spawn_allowed("yes and tell me more about Monaco") is False+++def test_sub_prefixed_words_are_not_the_vehicle() -> None:+ """"subscribe" / "submit" / "subject" must not buy the longer cap."""+ assert llm_spawn_allowed("Where should I move next?") is False+ assert (+ llm_spawn_allowed("yes and subscribe me to the newsletter today please")+ is False+ )++def test_veto_closes_the_offer_window_for_good() -> None:assert llm_spawn_allowed("Find out where I should move next.") is Falseassert llm_spawn_allowed("No, don't.") is False