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(brain): a plain knowledge question can no longer force-spawn a Jarvis-Agent
Ruben Lütke817d75708777
diff --git a/jarvis/brain/manager.py b/jarvis/brain/manager.pyindex ab77f7ed0c..57641f900e 100644--- a/jarvis/brain/manager.py+++ b/jarvis/brain/manager.py@@ -891,8 +891,12 @@ _OPINION_ADVICE_QUESTION_RE = re.compile(# decision help (DE)r"|soll(?:te)?\s+ich\b[^?]*\boder\b"r"|was\s+(?:ist|w[äa]re|waere)\s+(?:besser|kl[üu]ger|klueger|sinnvoller)\b"- # conversational question opener (DE)- r"|ich\s+(?:hab|habe|h[äa]tte|haette)\s+(?:da\s+)?(?:mal\s+)?(?:noch\s+)?(?:'?ne|eine)\s+frage"+ # conversational question opener (DE). Adjectives/intensifiers between the+ # article and "Frage" must not blind the guard: "ich hab mal eine GANZ+ # GENERELLE Frage, wie viel Geld hat Elon Musk?" slipped past the rigid+ # "eine frage" form and force-spawned a worker for a one-search knowledge+ # question (live bug 2026-07-16, voice session 11:49).+ r"|ich\s+(?:hab|habe|h[äa]tte|haette)\s+(?:da\s+)?(?:mal\s+)?(?:noch\s+)?(?:'?ne|eine)\s+(?:[\w-]+\s+){0,3}?frage"r"|kann\s+ich\s+dich\s+(?:mal\s+)?(?:was|etwas)\s+fragen"# advice / opinion (EN)r"|what\s+(?:would|do)\s+you\s+(?:recommend|suggest|advise|think)\b"@@ -900,12 +904,12 @@ _OPINION_ADVICE_QUESTION_RE = re.compile(r"|should\s+i\b[^?]*\bor\b"r"|(?:what(?:'s|\s+is)\s+)?your\s+(?:opinion|advice|take|recommendation)\b"r"|do\s+you\s+think\b"- r"|i\s+(?:have|'ve\s+got|got)\s+a\s+question\b"+ r"|i\s+(?:have|'ve\s+got|got)\s+a\s+(?:[\w-]+\s+){0,3}?question\b"r"|can\s+i\s+ask\s+you\b"# advice / opinion (ES)r"|qu[ée]\s+(?:me\s+)?(?:recomiendas|aconsejas|sugieres)\b"r"|qu[ée]\s+(?:opinas|piensas|crees)\b"- r"|tengo\s+una\s+pregunta\b"+ r"|tengo\s+una\s+(?:[\w-]+\s+){0,3}?pregunta\b"r"|deber[íi]a\s+"r")",re.IGNORECASE,@@ -5336,6 +5340,27 @@ class BrainManager:# a build verb, so a pure answer ("write a short summary") stays inline.if self._research_wants_artifact(t):return True+ # A turn in QUESTION form is conversation: the user asks, Jarvis+ # answers inline (search_web stays available). The generic-work+ # path rests on has_action_intent, whose verb catalogue collides+ # with everyday nouns ("Frage" -> "frag", "Buch" -> "buch"), so a+ # plain knowledge question could still be classified as generic+ # sub-agent work and force-spawn a full worker (live bug+ # 2026-07-16, voice session 11:49: "…ganz generelle Frage, wie+ # viel Geld hat Elon Musk gerade aktuell?" dispatched an Opus+ # mission for a one-search answer; user mandate: a Jarvis-Agent+ # needs a command or an explicitly named vehicle, never a+ # question). Explicit triggers returned True above (AD-S9) and+ # artifact builds returned just before this, so a question that+ # genuinely commissions heavy work still spawns; a working+ # question ("Kannst du X fixen?") keeps LLM discretion — the+ # spawn tools stay in its surface on action-intent turns.+ if _is_plain_knowledge_question(t):+ log.info(+ "force-spawn skipped: question-form turn — generic-work "+ "path needs a command, answering inline"+ )+ return Falsereturn self._is_generic_subagent_work(t)if verb_re.search(t):return Truediff --git a/jarvis/core/capabilities.py b/jarvis/core/capabilities.pyindex 87db077810..63d25ba164 100644--- a/jarvis/core/capabilities.py+++ b/jarvis/core/capabilities.py@@ -97,6 +97,30 @@ _UNIVERSAL_ACTION_VERBS: frozenset[str] = frozenset({"such", "suche", "sucht", "search", "find", "finde",})+# German deverbal NOUNS collide with catalogue verbs after case-folding:+# "Frage" -> "frag"/"frage", "Antwort" -> "antwort", "Suche" -> "such".+# "Du, ich hab mal eine ganz generelle Frage, wie viel Geld hat Elon Musk?"+# is a question ANNOUNCEMENT, yet the verb sweep read the noun as an+# imperative, has_action_intent returned True, and the strict-mode+# force-spawn gate dispatched a full background worker for a one-search+# knowledge question (live bug 2026-07-16, voice session 11:49).+#+# A noun occurrence is deterministically recognisable in German: it directly+# follows a (feminine) determiner, optionally with intensifiers / inflected+# attributive adjectives in between ("eine ganz generelle Frage", "die kurze # i18n-allow: bug quote+# Antwort", "noch 'ne Frage"). Such spans are masked out BEFORE the verb+# sweep. A genuine imperative never follows a determiner ("Frag Anna, ob …",+# "… und frag sie") and still matches. Interior words must carry a German+# attributive-adjective ending or be a known intensifier, so an object+# phrase like "eine Mail an Anna schicken" can never be swallowed.+_DEVERBAL_NOUN_SPAN_RE = re.compile(+ r"\b(?:'?ne|eine|meine|deine|seine|ihre|unsere|keine|die|diese|welche|" # i18n-allow: speech input+ r"(?:so|noch)\s+(?:'?ne|eine))" # i18n-allow: German speech-input matching data+ r"(?:\s+(?:ganz|sehr|echt|wirklich|mal|noch|total|ziemlich|relativ|" # i18n-allow: speech input+ r"[a-z0-9-]+(?:e|en|er|es)))*"+ r"\s+(?:frage|fragen|antwort|antworten|suche)\b" # i18n-allow: speech input+)+# ---------------------------------------------------------------------------# Core dataclass@@ -250,7 +274,10 @@ class CapabilityRegistry:Smalltalk / Q&A utterances ("wie spaet ist es", "was ist Python")match neither and return False."""- normalised = _normalize(utterance)+ # Mask determiner-led deverbal nouns ("eine ganz generelle Frage",+ # "die Antwort") so they cannot impersonate their verb stems in the+ # sweeps below — see _DEVERBAL_NOUN_SPAN_RE for the live bug.+ normalised = _DEVERBAL_NOUN_SPAN_RE.sub(" ", _normalize(utterance))# (a) universal catalogue — covers email/calendar/order/etc. even# when no capability is registered for them.for v in _UNIVERSAL_ACTION_VERBS:diff --git a/tests/unit/brain/test_routing.py b/tests/unit/brain/test_routing.pyindex 2cc4a86870..2864fe5c0e 100644--- a/tests/unit/brain/test_routing.py+++ b/tests/unit/brain/test_routing.py@@ -1205,6 +1205,12 @@ def test_instructional_questions_do_not_force_spawn(utterance: str) -> None:"Ich hab da mal eine Frage: was hältst du davon?",# filler particle "halt" collides with the action verb "halt""Ich hab mir das halt echt überlegt, was meinst du dazu?",+ # Live bug 2026-07-16 (voice session 11:49): adjectives between the+ # article and "Frage" blinded the opener guard, the noun tripped+ # has_action_intent, and a one-search knowledge question dispatched a+ # full Opus mission ("Da kümmert sich gerade ein Jarvis Agent drum").+ "Du, ich hab mal eine ganz generelle Frage, wie viel Geld ähm hat "+ "eigentlich Elon Musk gerade aktuell?",],)def test_opinion_advice_questions_do_not_force_spawn(utterance: str) -> None:@@ -1280,6 +1286,62 @@ def test_opinion_advice_predicate_ignores_commands(utterance: str) -> None:)+ "utterance",+ [+ # Verb-noun collisions the noun masking does NOT cover ("Buch" ->+ # catalogue verb "buch", "Post" -> "post" after a masculine+ # determiner): the question form itself must stand the generic-work+ # force-spawn down.+ "Kannst du mir sagen, was in dem Buch steht?",+ "Wer hat diesen Post geschrieben?",+ ],+)+def test_question_form_never_reaches_generic_work_spawn(utterance: str) -> None:+ """A turn in QUESTION form is conversation — the strict-mode generic-work+ path (has_action_intent + no capability) must never force-spawn it (live+ bug 2026-07-16, voice session 11:49: a plain knowledge question dispatched+ a full worker). Explicit triggers and artifact builds are checked before+ this stand-down and still spawn."""+ from jarvis.core.capabilities import get_registry+ from jarvis.core.capabilities_seed import seed_registry++ reg = get_registry()+ snapshot = dict(reg._caps) # noqa: SLF001 — test fixture state restore+ seed_registry(reg)+ try:+ manager, _executor = _manager_with_spawn(force_spawn_mode="strict")+ assert manager._should_force_spawn(utterance) is False, (+ f"question-form turn {utterance!r} wrongly force-spawned a worker"+ )+ finally:+ reg._caps.clear() # noqa: SLF001+ reg._caps.update(snapshot) # noqa: SLF001+++def test_explicit_trigger_question_still_spawns() -> None:+ """Naming the vehicle stays unambiguous even in question form — the AD-S9+ hoist runs BEFORE the question-form stand-down (user mandate 2026-06-15)."""+ from jarvis.core.capabilities import get_registry+ from jarvis.core.capabilities_seed import seed_registry++ reg = get_registry()+ snapshot = dict(reg._caps) # noqa: SLF001 — test fixture state restore+ seed_registry(reg)+ try:+ manager, _executor = _manager_with_spawn(force_spawn_mode="strict")+ utterance = (+ "Kannst du einen Subagenten spawnen, der recherchiert, wie viel "+ "Geld Elon Musk gerade hat?"+ )+ assert manager._should_force_spawn(utterance) is True, (+ "an explicitly named vehicle must spawn even in question form"+ )+ finally:+ reg._caps.clear() # noqa: SLF001+ reg._caps.update(snapshot) # noqa: SLF001++@pytest.mark.parametrize("utterance",[diff --git a/tests/unit/core/test_capabilities.py b/tests/unit/core/test_capabilities.pyindex 2931cf298c..9af31a7ede 100644--- a/tests/unit/core/test_capabilities.py+++ b/tests/unit/core/test_capabilities.py@@ -460,3 +460,30 @@ class TestSeedRegistry:assert self.reg.has_action_intent("wie ist das Wetter?" # i18n-allow) is False++ def test_has_action_intent_deverbal_noun_is_not_a_command(self) -> None:+ """Determiner-led deverbal nouns ('eine ganz generelle Frage', 'die # i18n-allow: bug quote+ Antwort') must not impersonate their verb stems ('frag', 'antwort'):+ the collision classified a plain knowledge question as generic+ sub-agent work and force-spawned a full background worker (live bug+ 2026-07-16, voice session 11:49)."""+ assert self.reg.has_action_intent(+ "Du, ich hab mal eine ganz generelle Frage, wie viel Geld ähm " # i18n-allow: bug quote+ "hat eigentlich Elon Musk gerade aktuell?"+ ) is False+ assert self.reg.has_action_intent(+ "Was ist die Antwort auf das Leben?" # i18n-allow: noun collision under test+ ) is False+ assert self.reg.has_action_intent(+ "Ich hätte da noch eine kurze Frage zu dem Thema." # i18n-allow: under test+ ) is False++ def test_has_action_intent_keeps_genuine_ask_imperatives(self) -> None:+ """A real imperative never follows a determiner — masking the noun+ spans must not lose genuine ask/send commands."""+ assert self.reg.has_action_intent(+ "Frag Anna, ob sie morgen Zeit hat." # i18n-allow: imperative under test+ ) is True+ assert self.reg.has_action_intent(+ "Schick eine Mail an Anna und frag sie, ob es morgen passt." # i18n-allow: imperative under test+ ) is True