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): a completion is only spoken when something really ran
rubenluetke10-beep4ef8ddc68e65
diff --git a/jarvis/brain/action_honesty.py b/jarvis/brain/action_honesty.pyindex 60ca88d2fa..531e17355e 100644--- a/jarvis/brain/action_honesty.py+++ b/jarvis/brain/action_honesty.py@@ -43,7 +43,9 @@ _FALSE_COMPLETION_RE = re.compile(r"(?:dir|fur\s+dich)\b|" # i18n-allow: German output matcherr"\bich\s+habe\s+(?:dir|fur\s+dich)\s+" # i18n-allow: DE outputr"(?:gerade\s+)?.{0,48}"- r"(?:gespielt|geoffnet|gestartet|gesendet|" # i18n-allow: DE output+ r"(?:gespielt|abgespielt|angemacht|angeschaltet|" # i18n-allow: DE output+ r"eingeschaltet|aufgelegt|rausgesucht|herausgesucht|" # i18n-allow: DE output+ r"geoffnet|gestartet|gesendet|" # i18n-allow: DE outputr"geschickt|gespeichert|erledigt)\b|" # i18n-allow: DE outputr"\bi(?:'m|\s+am)\s+(?:playing|opening|starting|sending|saving)\s+"r"(?:you\s+)?(?:a|the|your)\b|"@@ -56,7 +58,19 @@ _FALSE_COMPLETION_RE = re.compile(r"(?:playlist|cancion|musica)\b|" # i18n-allow: ES outputr"\bte\s+(?:envio|abro)\s+(?:el|la|un|una|tu)\b|" # i18n-allow: ES outputr"\bestoy\s+(?:reproduciendo|abriendo|iniciando|enviando)\b|" # i18n-allow- r"\bhe\s+(?:reproducido|abierto|iniciado|enviado|guardado)\b" # i18n-allow+ r"\bhe\s+(?:reproducido|abierto|iniciado|enviado|guardado)\b|" # i18n-allow+ # 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 every+ # guard while the turn had made zero function calls.+ r"\b(?:laufen|lauft|spielt|spielen|" # i18n-allow: DE output+ r"ertont|erklingt)\s+(?:jetzt|gerade|nun|" # i18n-allow: DE output+ r"bereits|schon)\b|" # i18n-allow: DE output+ r"\b(?:jetzt|gerade|nun)\s+(?:am\s+)?" # i18n-allow: DE output+ r"(?:laufen|lauft|spielt|spielen)\b|" # i18n-allow: DE output+ r"\b(?:is|are)\s+(?:playing|running)\s+(?:now|already)\b|"+ r"\b(?:now|already)\s+(?:playing|running)\b|"+ r"\b(?:ya\s+)?(?:esta|estan)\s+sonando\b" # i18n-allow: ES outputr")")@@ -161,6 +175,47 @@ _SUBORDINATE_OPENER_RE = re.compile(r")\b")+# Two clause shapes that look like delivered content to the structural+# substance test but can never BE delivered content. They are discounted only+# in the false-completion path (``has_false_completion_claim``), never in+# ``_analyse`` — a real answer must keep every chance to survive.+#+# A relative continuation elaborates the claim it hangs off ("… songs, which+# you can focus to"); it has no meaning once that claim is gone. Only the+# unambiguous openers are listed: in German a bare definite article and a+# relative pronoun are the same word, so treating one as a dependent tail+# would discard a real result that merely opens with an article.+_DEPENDENT_CONTINUATION_RE = re.compile(+ r"^(?:(?:und|oder|aber|and|or|but|y|pero)\s+)?" # i18n-allow: DE/ES matcher+ r"(?:"+ r"(?:bei|mit|auf|in|zu|von|fur|durch|uber)\s+" # i18n-allow: German output matcher+ r"(?:denen|dem|der|die|das|welchen|welcher|welche)\b|" # i18n-allow: DE+ r"wo(?:bei|mit|rauf|ran|durch|von)?\b|" # i18n-allow: German output matcher+ r"so\s+dass\b|" # i18n-allow: German output matcher+ r"(?:which|where|whom)\b|"+ r"(?:so|that)\s+you\s+can\b|"+ r"(?:con|en|para|sobre)\s+(?:los|las|el|la)\s+que\b|" # i18n-allow: ES+ r"donde\b" # i18n-allow: Spanish output matcher+ r")"+)++# A send-off carries goodwill, not a result. Without this, a two-word+# "enjoy!" clears the content bar and rescues the false completion in+# front of it.+_COURTESY_RE = re.compile(+ r"(?:"+ r"\bviel\s+(?:spass|vergnugen|freude|erfolg)\b|" # i18n-allow: DE output+ r"\bich\s+hoffe\b|\bhoffentlich\b|" # i18n-allow: German output matcher+ r"\bes\s+gefallt\s+dir\b|" # i18n-allow: German output matcher+ r"\b(?:lass\s+es\s+dir\s+gefallen|gute\s+unterhaltung)\b|" # i18n-allow: DE+ r"\b(?:enjoy|have\s+fun)\b|"+ r"\bi\s+hope\b|\bhope\s+you\b|"+ r"\b(?:que\s+lo\s+disfrutes|espero\s+que|" # i18n-allow: Spanish output matcher+ r"buena\s+escucha)\b" # i18n-allow: Spanish output matcher+ r")"+)++_TRAILING_CONJUNCTION_RE = re.compile(r"\s+(?:und|oder|aber|and|or|but|y|pero)$" # i18n-allow: German/Spanish output matcher)@@ -327,14 +382,34 @@ def has_false_completion_claim(text: str) -> bool:without a tool call. The deferred-promise analyser cannot see these:the fake result is the tail, so they look delivered. A list or answerin another clause is substance and must not be replaced.++ Two clause shapes are discounted before that substance question is asked,+ because neither can be a delivered result: a relative continuation of the+ false completion itself, and a send-off. Live 2026-08-22 18:22 — a turn+ that picked out songs, said they were now playing on YouTube Music and+ wished the user fun was spoken with zero function calls. Both trailing+ clauses cleared the structural substance bar, so the guard read the whole+ turn as a delivered answer. The verbatim text is in the regression test."""clauses = _split_clauses(text)if not any(_clause_is_false_completion(clause) for clause in clauses):return False- return not any(- clause.substance and not _clause_is_false_completion(clause)- for clause in clauses- )+ previous_was_claim = False+ for clause in clauses:+ if _clause_is_false_completion(clause):+ previous_was_claim = True+ continue+ if not clause.substance:+ continue+ normalized = _normalize(clause.body).strip()+ if _COURTESY_RE.search(normalized):+ continue+ if previous_was_claim and _DEPENDENT_CONTINUATION_RE.match(normalized):+ # It elaborates the claim in front of it and dies with it.+ continue+ previous_was_claim = False+ return False+ return Truedef has_unbacked_action_claim(text: str) -> bool:diff --git a/jarvis/brain/tool_gateway.py b/jarvis/brain/tool_gateway.pyindex 7860f60bc3..57f6051eba 100644--- a/jarvis/brain/tool_gateway.py+++ b/jarvis/brain/tool_gateway.py@@ -70,6 +70,7 @@ class BrainSupervisorToolGateway:input_schema=copy.deepcopy(schema),risk_tier=risk_tier,is_action_tool=bool(getattr(tool, "is_action_tool", False)),+ yields_instructions_only=bool(getattr(tool, "yields_instructions_only", False)),risk_tier_for_args=hook if callable(hook) else None,describe_args=impact if callable(impact) else None,)diff --git a/jarvis/core/protocols.py b/jarvis/core/protocols.pyindex 2ceb829945..2a7b5994af 100644--- a/jarvis/core/protocols.py+++ b/jarvis/core/protocols.py@@ -191,6 +191,13 @@ class SupervisorToolDescriptor:input_schema: dict[str, Any]risk_tier: RiskTieris_action_tool: bool = False+ # Whether this tool only HANDS BACK TEXT for the caller to act on, with no+ # effect of its own (the skill instruction loader is the one shipped case).+ # A successful call is therefore no evidence that anything the model+ # promised actually happened, which is exactly what the realtime honesty+ # guard asks. Live 2026-08-22: two music turns called only the instruction+ # loader, and "a tool succeeded" let the guard pass a fabricated result.+ yields_instructions_only: bool = False# Optional per-call hook (same contract as ``Tool.risk_tier_for_args``).# Catalog build captures it so the hybrid execute guard can treat a# ``now_playing`` read as ``safe`` without holding the Tool object.diff --git a/jarvis/plugins/tool/run_skill.py b/jarvis/plugins/tool/run_skill.pyindex 723c02152c..d096f4ba6d 100644--- a/jarvis/plugins/tool/run_skill.py+++ b/jarvis/plugins/tool/run_skill.py@@ -76,6 +76,9 @@ class RunSkillTool:name: str = "run-skill"risk_tier: str = "monitor"+ #: This tool RETURNS INSTRUCTIONS; it never performs the skill. Callers+ #: that ask "did anything actually happen this turn?" must not count it.+ yields_instructions_only: bool = Truedescription: str = ("Load an installed skill's instructions by name and follow them. ""Use this tool when the user request matches one of the skills listed "diff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.pyindex 1ddc53d74b..a056c580d1 100644--- a/jarvis/realtime/session.py+++ b/jarvis/realtime/session.py@@ -7265,6 +7265,23 @@ class RealtimeVoiceSession:)return True+ def _has_execution_evidence(self) -> bool:+ """Whether anything this turn actually DID something.++ A tool that only hands instructions back to the model (``run-skill``)+ succeeds without touching the world, so counting it here is what let+ a fabricated "it is playing now" through on 2026-08-22: the skill+ loader ran, the music tool never did, and the guard below read the+ loader's success as proof the promise was kept.+ """+ if not self._executed_tool_names:+ return False+ bridge = self._tool_bridge+ instruction_only = getattr(bridge, "instruction_only_tool_names", frozenset())+ if not instruction_only:+ return True+ return bool(self._executed_tool_names - set(instruction_only))+async def _recover_unbacked_action_claim(self) -> bool:"""Turn a provider's unsupported action promise into a real outcome.@@ -7277,7 +7294,7 @@ class RealtimeVoiceSession:"""if (self._external_update is not None- or self._executed_tool_names+ or self._has_execution_evidence()or self._native_tools_in_flightor self._delegate_delivery_started()or not has_unbacked_action_claim(self._provider_output_probe)@@ -8336,7 +8353,9 @@ class RealtimeVoiceSession:# A tool may have succeeded without a retained result only through a# legacy/custom bridge. Never replay that side-effecting user request.- if self._executed_tool_names:+ # An instruction load is not side-effecting, so it must not block the+ # replay of a request whose real action never ran.+ if self._has_execution_evidence():from jarvis.voice.action_phrases import action_phraseif self._outage_notice_allowed():diff --git a/tests/unit/brain/test_action_honesty.py b/tests/unit/brain/test_action_honesty.pyindex 5296a855dc..0ca59be9d7 100644--- a/tests/unit/brain/test_action_honesty.py+++ b/tests/unit/brain/test_action_honesty.py@@ -270,3 +270,74 @@ def test_packaged_persona_forbids_narrating_a_future_action() -> None:assert "emit the tool call without narrating a future action first" in promptassert "a promise is not execution evidence" in prompt+++ "text",+ [+ # Live 2026-08-22 18:22, gemini-live hybrid, zero function calls:+ # the whole turn was spoken as a finished result.+ (+ "Ich habe dir ein paar Lieder rausgesucht, bei denen du " # i18n-allow: German runtime fixture+ "dich gut konzentrieren kannst. Sie laufen jetzt auf " # i18n-allow: German runtime fixture+ "YouTube Music. Viel Spaß dabei!" # i18n-allow: German runtime fixture+ ),+ # Live 2026-08-22 18:16, same session shape, Spotify skill.+ (+ "Alles klar! Ich habe dir entspannte Musik angemacht, " # i18n-allow: German runtime fixture+ "damit du dich ein bisschen zurücklehnen kannst. " # i18n-allow: German runtime fixture+ "Ich hoffe, es gefällt dir!" # i18n-allow: German runtime fixture+ ),+ "Die Musik läuft jetzt.", # i18n-allow: German runtime fixture+ "Your song is playing now on the speaker.",+ "La canción ya está sonando.", # i18n-allow: Spanish runtime fixture+ ],+)+def test_spoken_completions_without_a_tool_call_are_false_completions(+ text: str,+) -> None:+ """A world-state claim names no actor, so the first-person matchers miss it.++ The forensic that produced this test: two voice turns reported music+ playing while ``tool_calls`` held only the instruction loader, and this+ predicate returned False for both, so nothing was withheld.+ """+ assert has_false_completion_claim(text) is True+ assert has_unbacked_action_claim(text) is True+++ "text",+ [+ # A delivered result after the claim keeps the whole text.+ (+ "Ich habe dir die Zusammenfassung geschickt. Der Umsatz " # i18n-allow: German runtime fixture+ "lag bei 1,2 Millionen Euro im dritten Quartal." # i18n-allow: German runtime fixture+ ),+ "Ich habe dir die Datei gespeichert. Sie liegt jetzt im Ordner Downloads.", # i18n-allow: German runtime fixture+ # A present-tense "running now" about something other than the+ # promised action.+ (+ "Die Sitzung läuft jetzt schon zwanzig Minuten, " # i18n-allow: German runtime fixture+ "also fassen wir zusammen." # i18n-allow: German runtime fixture+ ),+ "Es sind 20 Grad und sonnig.", # i18n-allow: German runtime fixture+ "I checked the calculation: the result is 42.",+ ],+)+def test_a_delivered_result_is_never_read_as_a_false_completion(text: str) -> None:+ assert has_false_completion_claim(text) is False+++def test_a_send_off_alone_does_not_rescue_a_false_completion() -> None:+ """Goodwill is not substance.++ A two-word send-off clears the content bar on structure alone, which is+ what let the YouTube Music turn read as an answer.+ """+ assert (+ has_false_completion_claim(+ "Ich habe dir die Playlist gestartet. Viel Spaß dabei!" # i18n-allow: German runtime fixture+ )+ is True+ )diff --git a/tests/unit/brain/test_run_skill_tool.py b/tests/unit/brain/test_run_skill_tool.pyindex 916da64a3f..ba677cd13c 100644--- a/tests/unit/brain/test_run_skill_tool.py+++ b/tests/unit/brain/test_run_skill_tool.py@@ -544,3 +544,14 @@ async def test_a_music_skill_stays_when_nothing_is_connected(monkeypatch) -> Nonassert result.success is Trueassert result.output["skill_name"] == "plugin-spotify"+++def test_the_skill_loader_declares_that_it_only_yields_instructions() -> None:+ """The flag the realtime honesty guard reads.++ ``run-skill`` returns a skill's steps for the model to follow; it performs+ nothing itself. Callers asking "did this turn actually do anything?" must+ be able to tell that apart from a tool with an effect, which is what a+ 2026-08-22 voice turn got wrong when it announced music that never played.+ """+ assert RunSkillTool.yields_instructions_only is Truediff --git a/tests/unit/realtime/test_session.py b/tests/unit/realtime/test_session.pyindex 1eec161832..645472d181 100644--- a/tests/unit/realtime/test_session.py+++ b/tests/unit/realtime/test_session.py@@ -9373,3 +9373,60 @@ async def test_a_turn_without_a_boundary_releases_the_microphone_fast() -> None:"should fire at ~2 s of provider silence")await sess.end(reason="test")+++class _InstructionOnlyBridge(FakeToolBridge):+ """A bridge whose only tool hands instructions back instead of acting."""++ instruction_only_tool_names = frozenset({"run-skill"})++ async def execute(self, *, wire_name, arguments):+ self.calls.append((wire_name, arguments))+ return "run-skill", {+ "success": True,+ "output": {+ "skill_name": "plugin-youtube_music",+ "execution": "inline",+ "directive": "Follow these skill instructions now, step by step.",+ },+ "error": None,+ }+++async def test_a_loaded_skill_is_not_evidence_that_the_action_ran():+ """Live 2026-08-22 18:22, the reported hallucination.++ The model called the skill loader, got instructions back, never called+ youtube_music, and spoke "Sie laufen jetzt auf YouTube Music". The loader+ counted as an executed tool, so the honesty guard stood down and the+ fabricated completion was spoken. A tool that only returns text is not+ evidence that anything happened.+ """+ bridge = _InstructionOnlyBridge()+ sess = _session(+ FakeProvider([]),+ tool_bridge=bridge,+ tool_mode="hybrid",+ )++ assert sess._has_execution_evidence() is False+ sess._executed_tool_names.add("run-skill")+ assert sess._has_execution_evidence() is False, (+ "loading a skill's instructions must never count as execution evidence"+ )+ sess._executed_tool_names.add("youtube_music")+ assert sess._has_execution_evidence() is True++ await sess.end(reason="test")+++async def test_a_bridge_without_the_capability_keeps_the_old_evidence_rule():+ """Degrade to the previous behaviour rather than dropping evidence."""+ sess = _session(FakeProvider([]), tool_bridge=FakeToolBridge(), tool_mode="hybrid")++ sess._executed_tool_names.add("open_app")+ assert sess._has_execution_evidence() is True++ await sess.end(reason="test")