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(voice): launch apps from punctuated English commands and catch bare "done" claims (#899)
Ruben Lütke338d8719b7fc
diff --git a/dodaios/brain/action_honesty.py b/dodaios/brain/action_honesty.pyindex d897e732b0..8f1cf09bf3 100644--- a/dodaios/brain/action_honesty.py+++ b/dodaios/brain/action_honesty.py@@ -61,6 +61,26 @@ _FALSE_COMPLETION_RE = re.compile(r"\bte\s+(?:envio|abro)\s+(?:el|la|un|una|tu)\b|" # i18n-allow: ES outputr"\bestoy\s+(?:reproduciendo|abriendo|iniciando|enviando)\b|" # i18n-allowr"\bhe\s+(?:reproducido|abierto|iniciado|enviado|guardado)\b|" # i18n-allow+ # App-launch completions that name the app instead of "you"/"the": a+ # user report (2026-10-26) had "open chrome" answered with "ok, done"+ # while Chrome never opened, and none of the shapes above saw it.+ # A bare "I opened X" is too broad (it is also how a readback reports+ # finished work), so the plain past tense only counts with "for you".+ r"\bi(?:'ve|\s+have)\s+(?:just\s+)?(?:opened|launched)\b|"+ r"\bi\s+(?:just\s+)?(?:opened|launched)\s+\S+(?:\s+\S+)?\s+for\s+you\b|"+ r"\b(?:is|are)\s+(?:now\s+)?(?:open|opened|launched|up)\s+now\b|"+ r"\b(?:is|are)\s+now\s+(?:open|opened|launched|up)\b|"+ # The gap may not hold a negation: the German honest fallback itself+ # says "I have started no action" and is not a claim.+ r"\bich\s+habe\s+(?:(?!\b(?:kein\w*|nicht|nichts|nie)\b).){0,48}" # i18n-allow: DE+ r"(?:geoffnet|gestartet)\b|" # i18n-allow: DE output+ r"\b(?:ist|sind)\s+(?:jetzt|nun)\s+" # i18n-allow: DE output+ r"(?:offen|geoffnet|gestartet)\b|" # i18n-allow: DE output+ # A clause that is nothing but "done" claims the whole request is+ # finished. The leading "okay," is its own clause and carries no content.+ r"^(?:all\s+)?(?:done|finished)$|"+ r"^(?:ist\s+|schon\s+)?erledigt$|" # i18n-allow: DE output+ r"^(?:listo|hecho)$|" # i18n-allow: ES output# World-state completions name no actor at all ("it is playing now"),# so none of the first-person alternatives above can see them. Live# 2026-08-22 18:22: "Sie laufen jetzt auf YouTube Music" cleared everydiff --git a/dodaios/brain/local_action_gate.py b/dodaios/brain/local_action_gate.pyindex 6f95142746..fd3982b903 100644--- a/dodaios/brain/local_action_gate.py+++ b/dodaios/brain/local_action_gate.py@@ -426,7 +426,12 @@ _AND_RE = re.compile(r"\b(?:und|and)\b", re.IGNORECASE)# folded into ``is_open_app_intent`` — that predicate is also the force-spawn# guard, and a negated open must still count as an open there (to stay OFF the# sub-agent worker path), just not trigger an actual launch here.-_OPEN_NEGATION_RE = re.compile(r"\bnicht\b|\bkein\w*\b|\bniemals\b", re.IGNORECASE)+# English forms too: "Don't open Chrome." used to launch Chrome.+_OPEN_NEGATION_RE = re.compile(+ r"\bnicht\b|\bkein\w*\b|\bniemals\b" # i18n-allow: German input matcher+ r"|\bdon'?t\b|\bdo\s+not\b|\bnever\b",+ re.IGNORECASE,+)# Signals that the request is NOT a plain desktop app-open but heavy worker /# external-system work, which a sandboxed worker (not computer-use) owns. This# is the single veto consulted by is_open_app_intent (and therefore by both the@@ -635,6 +640,9 @@ def is_open_app_intent(text: str) -> bool:_APP_ALIASES = {"chrome": "chrome","google chrome": "chrome",+ # Speech-to-text often drops the final "e" ("open chrom").+ "chrom": "chrome",+ "google chrom": "chrome","firefox": "firefox","edge": "msedge","microsoft edge": "msedge",@@ -1096,6 +1104,9 @@ def _match_scripted_local_plan(text: str) -> LocalActionPlan | None:return None+_WORD_PUNCTUATION = ".,!?;:\"'()[]…"++def _extract_known_app(text: str) -> str | None:"""Return the canonical app for the FIRST known app name in a normalisedopen-app utterance, else ``None``.@@ -1108,7 +1119,11 @@ def _extract_known_app(text: str) -> str | None:MUST first confirm :func:`is_open_app_intent` so a bare app mention in anon-open sentence ("ich höre Spotify gern") never launches anything."""- tokens = [t for t in text.split() if t]+ # Strip punctuation glued to a word: speech-to-text writes "Open Chrome."+ # and "chrome." is not an alias, so the command fell through to the LLM,+ # which could answer "done" without ever launching the app.+ tokens = [t.strip(_WORD_PUNCTUATION) for t in text.split()]+ tokens = [t for t in tokens if t]for window in (2, 1):for i in range(len(tokens) - window + 1):phrase = " ".join(tokens[i:i + window])diff --git a/tests/unit/brain/test_action_honesty.py b/tests/unit/brain/test_action_honesty.pyindex 71f8e2b700..16bf93e1c2 100644--- a/tests/unit/brain/test_action_honesty.py+++ b/tests/unit/brain/test_action_honesty.py@@ -343,3 +343,40 @@ def test_a_send_off_alone_does_not_rescue_a_false_completion() -> None:)is True)+++# User report 2026-10-26: "open chrome" was answered "ok, done" while Chrome+# never opened. Bare "done" and app-named launch claims must be caught.+ "text",+ [+ "Okay, done.",+ "Done.",+ "All done!",+ "Chrome is open now.",+ "Sure, Chrome is now open.",+ "I've opened Chrome.",+ "Okay, I opened Chrome for you.",+ "Ich habe Chrome geöffnet.", # i18n-allow: German model output+ "Chrome ist jetzt offen.",+ "Okay, erledigt.",+ "Listo.",+ ],+)+def test_bare_done_and_app_launch_claims_are_detected(text: str) -> None:+ assert has_unbacked_action_claim(text)+++ "text",+ [+ "The store is open until 8 pm.",+ "Is Chrome open?",+ "Getting things done is a book by David Allen.",+ "When you're done, tell me.",+ "Ist es erledigt?",+ "Here is the summary: the meeting is done at 5.",+ ],+)+def test_done_and_open_in_ordinary_answers_are_not_claims(text: str) -> None:+ assert not has_unbacked_action_claim(text)diff --git a/tests/unit/brain/test_local_action_gate.py b/tests/unit/brain/test_local_action_gate.pyindex 01d65a24db..071a1e0c7d 100644--- a/tests/unit/brain/test_local_action_gate.py+++ b/tests/unit/brain/test_local_action_gate.py@@ -1251,3 +1251,33 @@ def test_orders_still_reach_computer_use(utterance: str) -> None:def test_information_question_classifier(utterance: str, is_question: bool) -> None:"""The TASK-or-QUESTION decision itself, on already-normalised input."""assert _is_information_question(utterance) is is_question+++# User report 2026-10-26: speech-to-text writes "Open Chrome." with a full+# stop. "chrome." was not an alias, so the command went to the LLM, which+# answered "done" without launching anything.+ ("utterance", "app"),+ [+ ("Open Chrome.", "chrome"),+ ("Open Chrome!", "chrome"),+ ("Open chrome, please.", "chrome"),+ ("Launch Chrome.", "chrome"),+ ("Can you open Chrome?", "chrome"),+ ("Open Google Chrome.", "chrome"),+ ("open chrom", "chrome"),+ ("Open Discord.", "discord"),+ ],+)+def test_english_open_with_punctuation_launches_directly(utterance: str, app: str) -> None:+ plan = match_local_action(utterance, "en", _registry=None)+ assert plan is not None+ assert plan.mode is LocalActionMode.DIRECT+ assert plan.tool_calls == (LocalToolCall(name="open_app", args={"app_name": app}),)+++ "utterance", ["Don't open Chrome.", "Do not open Spotify.", "Never open Discord."]+)+def test_english_negated_open_launches_nothing(utterance: str) -> None:+ assert match_local_action(utterance, "en", _registry=None) is None