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(cu-gate): stop a tech product name from unlocking the desktop
Ruben Lütke77d921086fea
diff --git a/jarvis/brain/cu_gate.py b/jarvis/brain/cu_gate.pyindex 4ae988c75e..6cf0523521 100644--- a/jarvis/brain/cu_gate.py+++ b/jarvis/brain/cu_gate.py@@ -63,6 +63,39 @@ _UMLAUT_TRANSLITERATION = str.maketrans()+# Tech proper names and terms of art that merely CONTAIN a vehicle token.+# Masked out of the turn before the vehicle match runs, so a product name can+# never read as an on-screen command. Live incident 2026-07-27 11:52 (voice+# session 57cc5f5f): "…BGE-M3 und Gemini oder Open AI # i18n-allow: live quote+# Embedding 3 Large, was der Unterschied?" — a pure # i18n-allow: quote cont.+# model-comparison question. The provider name+# "Open AI" matched the English open-verb, the gate allowed, and the router's+# computer_use call took a screenshot and started driving the desktop.+#+# This is the same defect class the local-action gate fixed on 2026-07-10+# ("OpenRouter-Zugang checkst" read as "open X and Y"); the fix never reached+# this gate. Masking beats inlining negative lookaheads: the vehicle pattern+# below is already dense, and every entry here carries its own reason.+#+# The mask is deliberately narrow — only multi-token names where the vehicle+# token is provably part of the NAME. A bare "Edge"/"Windows"/"Programm" stays+# a vehicle noun, because "mach den Edge zu" is a real desktop command.+_PRODUCT_NAME_NOISE_RE: re.Pattern[str] = re.compile(+ # "open" as a brand/license prefix, never the imperative verb. Written+ # with an optional space so both "openai" and "Open AI" are covered.+ r"\bopen[-\s]?(?:ai|router|source|weights?|models?|web[-\s]?ui|interpreter"+ r"|claw\w*|wake[-\s]?word|cv|ssl|vino|telemetry|street[-\s]?map)\b"+ # "window" as a model/attention term, never the desktop object.+ # i18n-allow: German/Spanish speech-input matching data+ r"|\b(?:context|kontext|contexto|sliding|rolling|attention|token)"+ r"[-\s]?(?:windows?|ventanas?)\b"+ # "edge" as an engineering term, never the browser.+ r"|\bedge[-\s]?(?:cases?|computing|functions?|runtimes?|deployments?)\b"+ r"|\bcutting[-\s]?edge\b",+ re.IGNORECASE,+)++# Explicit desktop-vehicle vocabulary (DE/EN/ES) — speech-input matching data.## Deliberate exclusions (each one is a live trap):@@ -73,10 +106,13 @@ _UMLAUT_TRANSLITERATION = str.maketrans(# only when not preceded by a question/genitive word.# * "google"/"search"/"such": search intent belongs to search_web, never to# the desktop — "google das im Browser" still passes via "browser".+# * bare "open\w*": it swallowed every "Open…" product name as an open-verb+# (see _PRODUCT_NAME_NOISE_RE). Pinned to the real English conjugations,+# exactly like ``_OPEN_VERB_RE`` in jarvis/brain/local_action_gate.py._DESKTOP_VEHICLE_RE: re.Pattern[str] = re.compile(r"(?:"# --- action verbs (en) ---- r"\bopen\w*\b|\blaunch\w*\b|\bclick\w*\b|\bdouble-?click\w*\b|\btap\b"+ r"\bopen(?:s|ed|ing)?\b|\blaunch\w*\b|\bclick\w*\b|\bdouble-?click\w*\b|\btap\b"r"|\bscroll\w*\b|\bdrag\w*\b|\bhover\b|\bpress\w*\b|\bpaste\b"r"|\bminimi[sz]e\b|\bmaximi[sz]e\b|\bnavigate\b|\bbrowse\b"r"|\blog\s?in\b|\bsign\s?in\b|\bgo\s+to\b"@@ -112,7 +148,15 @@ _DESKTOP_VEHICLE_RE: re.Pattern[str] = re.compile(def _normalized(text: str) -> str:- return (text or "").casefold().translate(_UMLAUT_TRANSLITERATION)+ """Casefold + transliterate, then blank out tech proper names.++ The mask runs BEFORE the vehicle match so a product name ("Open AI",+ "context window", "edge case") can never be read as an on-screen command.+ It substitutes a space, not the empty string, so the surrounding words keep+ their boundaries and a genuine command in the same turn still matches.+ """+ folded = (text or "").casefold().translate(_UMLAUT_TRANSLITERATION)+ return _PRODUCT_NAME_NOISE_RE.sub(" ", folded)def llm_computer_use_allowed(user_text: str) -> bool:diff --git a/tests/unit/brain/test_cu_gate.py b/tests/unit/brain/test_cu_gate.pyindex 3e45667e10..3ba6fd6328 100644--- a/tests/unit/brain/test_cu_gate.py+++ b/tests/unit/brain/test_cu_gate.py@@ -51,6 +51,64 @@ def test_knowledge_question_blocks_computer_use(utterance: str) -> None:assert llm_computer_use_allowed(utterance) is False+# ── tech proper names are not on-screen commands ──────────────────────────+#+# Live incident 2026-07-27 11:52 (voice session 57cc5f5f, flight recorder+# ActionProposed dispatch_to_harness/screenshot): a model-comparison question+# naming "Open AI Embedding 3 Large" matched the bare ``open\w*`` vehicle verb,+# the gate allowed, and computer_use screenshotted the desktop and started+# driving it until the user hit Escape. Same defect class the local-action gate+# fixed on 2026-07-10 for "OpenRouter" — it had never reached this gate.+++ "utterance",+ [+ # The live utterance, verbatim from the flight recorder.+ "Hey, kannst du mal einen Vergleich machen von den " # i18n-allow: live+ "beiden Modellen und zwar von den beiden Embedding " # i18n-allow: live+ "Modellen? Einmal von dem Embedding Modell ähm aus " # i18n-allow: live+ "Olama. Ich glaube, das nennt sich ähm BGE ähm " # i18n-allow: live+ "{gedankenstrich} M3 und Gemini oder ähm Open AI " # i18n-allow: live+ "Embedding 3 Large, was der Unterschied?", # i18n-allow: live+ # "open" as a brand/license prefix — spaced and unspaced.+ "Was ist der Unterschied zwischen OpenAI Embedding 3 " # i18n-allow: DE+ "Large und BGE-M3?", # i18n-allow: DE fixture+ "Was kostet OpenRouter pro Million Token?", # i18n-allow: DE fixture+ "Ist Open Source hier die bessere Wahl?", # i18n-allow: DE fixture+ "Was hältst du von Open Weights Modellen?", # i18n-allow: DE fixture+ "How does OpenCV compare to a vision model?",+ # "window" as a model term, never the desktop object.+ "Erklär mir das Context Window von Gemini 3 Pro", # i18n-allow: DE+ "What is sliding window attention?",+ # "edge" as an engineering term, never the browser.+ "Ist das ein Edge Case oder ein echter Bug?", # i18n-allow: DE fixture+ "Lohnt sich Edge Computing für uns?", # i18n-allow: DE fixture+ "Is that library still cutting edge?",+ ],+)+def test_tech_proper_names_never_read_as_a_desktop_command(utterance: str) -> None:+ assert llm_computer_use_allowed(utterance) is False+++ "utterance",+ [+ # Masking a product name must not disarm a real command in the SAME turn.+ "Mach mal ein Fenster auf und such nach Open AI Preisen.", # i18n-allow: DE trigger+ "Open Chrome and check the OpenRouter status page.",+ # The vehicle nouns themselves stay vehicles.+ "Mach den Edge zu.", # i18n-allow: DE trigger+ "Schließ das Fenster.", # i18n-allow: DE trigger+ # Real English open-verb conjugations still count.+ "Opening Notepad, please.",+ "He opened the wrong tab, fix it.",+ ],+)+def test_product_name_masking_leaves_real_commands_intact(utterance: str) -> None:+ assert llm_computer_use_allowed(utterance) is True++# ── explicit desktop asks keep passing ────────────────────────────────────