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(tests): make the suite tell the truth again — 0 failures
Harald13a6ad2440e2
diff --git a/jarvis/brain/model_catalog.py b/jarvis/brain/model_catalog.pyindex fd9dcc51c5..b54bb49fb9 100644--- a/jarvis/brain/model_catalog.py+++ b/jarvis/brain/model_catalog.py@@ -238,12 +238,18 @@ CURATED_MODELS: dict[str, list[ModelInfo]] = {("deepseek/deepseek-v4-pro", "DeepSeek V4 Pro"),]),- # Grok 4.3 is the universal default because Grok 4.5 is not yet available- # in every region. The authenticated live catalog replaces this fallback.+ # Grok 4.3 leads because it is the universal default — the newer families+ # are not available in every region, and this list is only the OFFLINE+ # fallback, so its head is what a downloader with no live catalog gets.+ # It must stay in step with ``jarvis.plugins.brain.grok.DEFAULT_MODEL``+ # (pinned by test_grok_has_authenticated_live_model_catalog): 4.6 was+ # inserted at the head without moving the default, which offered a model+ # as the pre-selected one that the client would not actually have used.+ # The authenticated live catalog replaces this fallback entirely."grok": _curated([- ("grok-4.6", "Grok 4.6"),("grok-4.3", "Grok 4.3"),+ ("grok-4.6", "Grok 4.6"),("grok-4.5", "Grok 4.5"),]),diff --git a/jarvis/skills/builtin/__init__.py b/jarvis/skills/builtin/__init__.pyindex 15d9fa2893..0ddafda639 100644--- a/jarvis/skills/builtin/__init__.py+++ b/jarvis/skills/builtin/__init__.py@@ -49,6 +49,7 @@ _PLUGIN_PAIRED_SKILLS: tuple[str, ...] = ("plugin-home_assistant","plugin-spotify","plugin-youtube_music",+ "plugin-higgsfield",)BUILTIN_SKILL_NAMES: tuple[str, ...] = (@@ -65,6 +66,11 @@ BUILTIN_SKILL_NAMES: tuple[str, ...] = (# no voice triggers (a trigger would make the router pick run_skill over the# cli_gcloud tool — see control-api). Gated by requires_tools=[cli_gcloud]."cli-gcloud",+ # jarvis-doc-author (2026-08-20): Diataxis rules for writing docs/ files.+ # Shipped on disk since it was authored but never listed, so it was never+ # copied to the user skills dir and never loaded — the same dead-bundle+ # defect the plugin list carries its own warning about.+ "jarvis-doc-author",) + _PLUGIN_PAIRED_SKILLSdiff --git a/jarvis/skills/eval_harness.py b/jarvis/skills/eval_harness.pyindex d5bbe3e55b..76cd541243 100644--- a/jarvis/skills/eval_harness.py+++ b/jarvis/skills/eval_harness.py@@ -22,7 +22,11 @@ from dataclasses import dataclass, fieldfrom pathlib import Pathfrom typing import Any-from jarvis.skills.guards import evaluate_guards+from jarvis.skills.guards import (+ VETO_AUTHORING_REQUEST,+ VETO_LIFECYCLE_REQUEST,+ evaluate_guards,+)from jarvis.skills.match_eval import BAND_NONE, band_at_least, evaluate_match#: Repo-relative location of the golden set.@@ -270,8 +274,89 @@ class Report:}+def _prefer_music_service(+ registry: Any, decision: Any, skill: Any, text: str+) -> tuple[Any, Any]:+ """Mirror ``BrainManager._prefer_music_service`` for the offline eval.++ Spotify and YouTube Music share one domain: the Spotify skill owns the+ GENERIC music vocabulary on purpose, and the brain then swaps to the+ service the user actually named or prefers. Without this step the eval+ scores "spiel meine playlist auf youtube music" as a Spotify capture and+ calls the shipped, correct routing a false fire.++ Both connectors count as connected here — the eval scores ROUTING, not the+ maintainer's credential state, and a fixture whose result depends on which+ plugins happen to be linked is not reproducible in CI.+ """+ from dataclasses import replace as _replace++ try:+ from jarvis.core.music_constants import MUSIC_PLUGIN_IDS+ from jarvis.core.music_service import resolve_music_service++ frontmatter = getattr(skill, "frontmatter", None)+ plugin_id = str(getattr(frontmatter, "plugin_id", "") or "").strip()+ if plugin_id not in MUSIC_PLUGIN_IDS:+ return decision, skill+ target = resolve_music_service(+ text,+ preferred="auto",+ connected=list(MUSIC_PLUGIN_IDS),+ matched=plugin_id,+ )+ if not target or target == plugin_id:+ return decision, skill+ sibling = registry.get(f"plugin-{target}")+ except Exception: # noqa: BLE001 — a routing nicety must never break the eval+ return decision, skill+ if sibling is None:+ return decision, skill+ top = _replace(decision.top, skill_name=sibling.name)+ return _replace(decision, top=top, candidates=(top,)), sibling++def _decide(registry: Any, text: str, lang: str = "auto") -> tuple[Any, str]:- """Run the real matcher + the real guards. Returns (decision, veto_reason)."""+ """Run the real matcher + the real guards. Returns (decision, veto_reason).++ Mirrors ``BrainManager._match_skill_for_turn`` channel for channel. An+ earlier version called ``evaluate_match`` alone, so it scored a SHORTER+ ladder than production runs and then reported production-correct routing as+ a failure: "erstell mir einen neuen Skill … mit YouTube Music" is resolved+ by the authoring channel in the brain (BUG-147) and was scored here as the+ music skill hijacking the turn. An eval that measures a different ladder+ than the thing it guards is not a guard.+ """+ from jarvis.skills.authoring_request import resolve_skill_authoring_request+ from jarvis.skills.explicit_request import resolve_explicit_skill_request++ # Channel 0 — the user NAMED a skill. Trigger-grade rights.+ explicit = resolve_explicit_skill_request(text, registry)+ if explicit is not None:+ explicit_skill, explicit_decision = explicit+ ladder = evaluate_guards(+ explicit_skill, user_text=text, evidence=explicit_decision.top.evidence+ )+ return explicit_decision, ladder.vetoed_by++ # Channel 0.5 — the user asked to CREATE or MANAGE a skill. Every service+ # named inside such a request is CONTENT, never a command to that service,+ # so no domain skill may capture even when its brand regex matches.+ authoring = resolve_skill_authoring_request(text, registry)+ if authoring is not None:+ if authoring.skill is None or authoring.kind == "lifecycle":+ veto = (+ VETO_LIFECYCLE_REQUEST+ if authoring.kind == "lifecycle"+ else VETO_AUTHORING_REQUEST+ )+ return authoring.decision, veto+ ladder = evaluate_guards(+ authoring.skill, user_text=text, evidence=authoring.decision.top.evidence+ )+ return authoring.decision, ladder.vetoed_by++ # Channel 1/2 — the author's trigger regex, then the relevance scorer.decision = evaluate_match(registry, text, lang=lang)if decision.top is None:return decision, ""@@ -279,6 +364,7 @@ def _decide(registry: Any, text: str, lang: str = "auto") -> tuple[Any, str]:skill = registry.get(decision.top.skill_name)except Exception: # noqa: BLE001return decision, ""+ decision, skill = _prefer_music_service(registry, decision, skill, text)ladder = evaluate_guards(skill,user_text=text,diff --git a/tests/fixtures/skill_routing/golden.yaml b/tests/fixtures/skill_routing/golden.yamlindex 9481dc062c..f685c158c8 100644--- a/tests/fixtures/skill_routing/golden.yaml+++ b/tests/fixtures/skill_routing/golden.yaml@@ -439,6 +439,27 @@ skills:min_band: narrowsource: authored+ plugin-higgsfield:+ positives:+ - text: "generier mir ein bild mit higgsfield"+ channel: trigger+ lang: de+ min_band: narrow+ source: authored+ - text: "create a video with higgsfield"+ channel: trigger+ lang: en+ min_band: narrow+ source: authored+ - text: "mach mir einen character in higgs field"+ channel: trigger+ lang: de+ min_band: narrow+ source: authored+ hard_negatives:+ - text: "was ist higgsfield eigentlich fuer ein dienst"+ reason: definitional question about the product, not a request to act+plugin-cal_com:positives:- text: "wann ist mein naechster termin bei cal com"@@ -489,15 +510,32 @@ skills:lang: demin_band: narrowsource: authored+ # The generic music capture, moved here from plugin-youtube_music+ # 2026-08-20: no brand word, so the shared music skill takes the turn and+ # music_service.reroute_music_tool picks the connected service at execute+ # time. Pinned so a future trigger edit cannot silently break the doctrine.+ - text: "play my liked songs"+ channel: trigger+ lang: en+ min_band: fire+ source: authoredhard_negatives:- text: "was ist spotify eigentlich fuer ein dienst"reason: definitional question about the product, not a request to actplugin-youtube_music:positives:- - text: "play my liked songs"- channel: relevance- lang: en+ # "play my liked songs" moved to plugin-spotify 2026-08-20. It carries no+ # brand word, and a play-verb next to a music noun is the GENERIC music+ # capture that plugin-spotify owns by design ("Generic capture lands+ # here, then music_service swaps to the preferred connected connector" —+ # plugin-spotify/SKILL.md, jarvis/core/music_service.py §3). Demanding a+ # brand-only skill win a brand-less sentence asked the matcher to+ # contradict the shipped routing doctrine; the connector is corrected at+ # execute time by reroute_music_tool, which is the real boundary.+ - text: "spiel meine playlist auf youtube music"+ channel: trigger+ lang: demin_band: firesource: authored- text: "zeig mir meine likes"@@ -528,8 +566,12 @@ skills:lang: demin_band: firesource: authored+ # Channel corrected 2026-08-20: the authoring channel (BrainManager+ # Channel 0.5) resolves this with trigger-grade rights, and the eval now+ # runs that same channel. `relevance` described the harness's old,+ # shorter ladder — not what the brain has actually been doing.- text: "turn this workflow into a skill"- channel: relevance+ channel: triggerlang: enmin_band: narrowsource: authoreddiff --git a/tests/unit/brain/test_custom_system_prompt.py b/tests/unit/brain/test_custom_system_prompt.pyindex 344fcb050e..61ec1483c8 100644--- a/tests/unit/brain/test_custom_system_prompt.py+++ b/tests/unit/brain/test_custom_system_prompt.py@@ -18,6 +18,14 @@ from jarvis.brain import persona_loaderdef _isolate_data_dir(tmp_path, monkeypatch: pytest.MonkeyPatch):"""Point the override file at a throwaway dir so tests never touch real data."""monkeypatch.setattr(core_config, "DATA_DIR", tmp_path)+ # Neutralise the active MODE too. ``load_effective_persona_prompt``+ # appends the mode block, and the mode is real user state that lives+ # outside DATA_DIR — so on any machine with a mode switched on these+ # comparisons failed against the bare default while CI, which has no+ # user state, stayed green. A test must not read the developer.+ monkeypatch.setattr(+ "jarvis.brain.modes.active_prompt_block", lambda: ""+ )return tmp_pathdiff --git a/tests/unit/brain/test_persona_loader.py b/tests/unit/brain/test_persona_loader.pyindex ef20f03463..c6119e7616 100644--- a/tests/unit/brain/test_persona_loader.py+++ b/tests/unit/brain/test_persona_loader.py@@ -145,6 +145,11 @@ def test_custom_override_wins_even_in_compact_mode(monkeypatch, tmp_path) -> Non"""User autonomy outranks the latency optimization: their exact wordsstay, whatever profile the provider asked for."""invalidate_cache()+ # The active MODE is appended by the loader and is real user state, so on a+ # machine with a mode switched on this compared "My own words." against+ # "My own words." plus the mode block. CI has no user state and stayed+ # green; the developer's own box failed. Isolate what is not under test.+ monkeypatch.setattr("jarvis.brain.modes.active_prompt_block", lambda: "")monkeypatch.setattr(pl, "read_custom_prompt", lambda: "My own words.")try:assert pl.load_effective_persona_prompt(compact=True) == "My own words."diff --git a/tests/unit/realtime/test_gemini_live.py b/tests/unit/realtime/test_gemini_live.pyindex 2aec01a35f..a82144126a 100644--- a/tests/unit/realtime/test_gemini_live.py+++ b/tests/unit/realtime/test_gemini_live.py@@ -770,7 +770,13 @@ async def test_explicit_reply_language_uses_the_session_instruction(_model, config = holder["client"].aio.live.connect_calls[0]assert config.system_instruction == "Reply only in Spanish for this turn."- assert config.speech_config is None+ # An unpinned card still gets an EXPLICIT voice. This used to assert+ # ``speech_config is None``, which is the state BUG-155 was about: Google's+ # unpinned native-audio default is undocumented, and leaving the field+ # empty made every progress and fallback line speak Charon while the+ # session spoke something else.+ prebuilt = config.speech_config.voice_config.prebuilt_voice_config+ assert prebuilt.voice_name == GeminiLiveProvider.default_voice# Gemini auto-responds; the required-tool hint remains a compatible no-op.await session.request_response(required_tool="jarvis_action")await session.close()diff --git a/tests/unit/realtime/test_session.py b/tests/unit/realtime/test_session.pyindex a4823b05b0..c9221afddf 100644--- a/tests/unit/realtime/test_session.py+++ b/tests/unit/realtime/test_session.py@@ -535,7 +535,12 @@ async def test_capability_probe_failure_crosses_to_next_provider_family():async def test_handshake_timeout_preserves_budget_for_next_family(monkeypatch):import jarvis.realtime.session as session_module- monkeypatch.setattr(session_module, "_PROVIDER_HANDSHAKE_TOTAL_TIMEOUT_S", 0.2)+ # 2.0 s total, i.e. ~1.0 s per family. The budget is split evenly, so at+ # the old 0.2 s the first family's share was 0.1 s and ordinary scheduling+ # jitter on a busy machine ate the remainder — the fallback then failed+ # with "budget exhausted" and the test failed for lack of clock rather+ # than lack of the behaviour it asserts.+ monkeypatch.setattr(session_module, "_PROVIDER_HANDSHAKE_TOTAL_TIMEOUT_S", 2.0)fallback = FakeProvider([])fallback.name = "working-family"messages = []@@ -550,7 +555,7 @@ async def test_handshake_timeout_preserves_budget_for_next_family(monkeypatch):await asyncio.wait_for(sess.handle_control({"type": "audio_start", "sample_rate": 16_000}),- timeout=0.5,+ timeout=5,)await sess.end(reason="test")@@ -5525,13 +5530,20 @@ async def test_empty_provider_turn_without_brain_speaks_local_error():@pytest.mark.asyncio-async def test_empty_recovery_response_uses_surface_tts_without_rerunning_brain():+async def test_empty_recovery_response_uses_surface_tts_without_rerunning_brain(+ monkeypatch,+):"""A third provider failure speaks the grounded result through local TTS.Empty turn, empty re-ask, Brain chain once, and the provider stays mute onthe delivered result too: the surface TTS speaks it, the brain is notre-run.++ The readback budget is shortened here because the turn must survive it+ twice: at the shipped 2.5 s this test could not fit inside its own 2 s+ deadline, so it failed on the clock rather than on the behaviour."""+ monkeypatch.setattr("jarvis.realtime.session._DELEGATE_READBACK_WAIT_S", 0.2)user_text = "Tell me a joke about penguins."recovered_reply = "We could build a tiny game together."brain = FakeBrain(replies=(recovered_reply,))@@ -6245,18 +6257,18 @@ async def test_multiple_delegate_calls_coalesce_to_one_brain_turn():brain = FakeBrain(replies=("First result.", "Second result."), bus=bus)provider = ToolResultGatedProvider([- RealtimeEvent(type="input_transcript", text="do both", is_final=True),+ RealtimeEvent(type="input_transcript", text="open the calculator", is_final=True),RealtimeEvent(type="tool_call",call_id="multi-1",tool_name="jarvis_action",- tool_args={"request": "first action"},+ tool_args={"request": "open the calculator"},),RealtimeEvent(type="tool_call",call_id="multi-2",tool_name="jarvis_action",- tool_args={"request": "second action"},+ tool_args={"request": "open the calculator"},),],[@@ -6319,12 +6331,12 @@ async def test_delegate_empty_brain_result_cannot_claim_action_success():brain = FakeBrain(replies=("",))provider = ToolResultGatedProvider([- RealtimeEvent(type="input_transcript", text="do it", is_final=True),+ RealtimeEvent(type="input_transcript", text="open the calculator", is_final=True),RealtimeEvent(type="tool_call",call_id="empty-result-1",tool_name="jarvis_action",- tool_args={"request": "do it"},+ tool_args={"request": "open the calculator"},),],[RealtimeEvent(type="turn_complete")],@@ -6348,12 +6360,12 @@ async def test_delegate_timeout_cancels_brain_and_cannot_publish_late(monkeypatcbrain = FakeBrain(gate=asyncio.Event(), bus=bus)provider = ToolResultGatedProvider([- RealtimeEvent(type="input_transcript", text="slow action", is_final=True),+ RealtimeEvent(type="input_transcript", text="open the calculator", is_final=True),RealtimeEvent(type="tool_call",call_id="timeout-1",tool_name="jarvis_action",- tool_args={"request": "slow action"},+ tool_args={"request": "open the calculator"},),],[@@ -6381,12 +6393,12 @@ async def test_delegate_empty_spoken_answer_uses_surface_tts_fallback():jsons: list[dict] = []provider = ToolResultGatedProvider([- RealtimeEvent(type="input_transcript", text="do it", is_final=True),+ RealtimeEvent(type="input_transcript", text="open the calculator", is_final=True),RealtimeEvent(type="tool_call",call_id="empty-1",tool_name="jarvis_action",- tool_args={"request": "do it"},+ tool_args={"request": "open the calculator"},),],[RealtimeEvent(type="turn_complete")],@@ -6411,12 +6423,12 @@ async def test_delegate_does_not_block_pump():jsons = []provider = FakeProvider([- RealtimeEvent(type="input_transcript", text="do the thing", is_final=True),+ RealtimeEvent(type="input_transcript", text="open the calculator", is_final=True),RealtimeEvent(type="tool_call",call_id="c-2",tool_name="jarvis_action",- tool_args={"request": "do the thing"},+ tool_args={"request": "open the calculator"},),RealtimeEvent(type="output_transcript_delta", text="Working on it."),]@@ -6426,10 +6438,17 @@ async def test_delegate_does_not_block_pump():await sess.handle_control({"type": "audio_start", "sample_rate": 16_000})await sess.wait_finished()- # The pump processed the later transcript while the brain turn still hangs.- assert any(- m.get("type") == "transcript" and m.get("role") == "assistant" for m in jsons- )+ # The pump processed the later events while the brain turn still hangs —+ # ``wait_finished`` returned with the gate still closed, and the transcript+ # that arrived after the tool call was surfaced.+ #+ # This used to assert an ASSISTANT transcript. It cannot any more, and that+ # is the correct behaviour, not a regression: provider chatter is held+ # while a delegate is pending, so the user does not hear a fresh-+ # conversation filler over the real answer being computed (live 2026-07-17+ # 09:23, the incident test_presence_check_during_pending_action… guards).+ # What this test is about is that the delegate does not BLOCK the pump.+ assert any(m.get("type") == "transcript" for m in jsons)assert provider.session.tool_results == []gate.set()@@ -6484,12 +6503,12 @@ async def test_delegate_timeout_sends_honest_failure(monkeypatch):brain = FakeBrain(gate=gate)provider = FakeProvider([- RealtimeEvent(type="input_transcript", text="slow task", is_final=True),+ RealtimeEvent(type="input_transcript", text="open the calculator", is_final=True),RealtimeEvent(type="tool_call",call_id="c-3",tool_name="jarvis_action",- tool_args={"request": "slow task"},+ tool_args={"request": "open the calculator"},),])@@ -6582,12 +6601,12 @@ async def test_delegate_tasks_cancelled_on_end():brain = FakeBrain(gate=gate)provider = FakeProvider([- RealtimeEvent(type="input_transcript", text="long task", is_final=True),+ RealtimeEvent(type="input_transcript", text="open the calculator", is_final=True),RealtimeEvent(type="tool_call",call_id="c-7",tool_name="jarvis_action",- tool_args={"request": "long task"},+ tool_args={"request": "open the calculator"},),])@@ -6607,12 +6626,12 @@ async def test_delegate_brain_exception_sends_safe_failure():brain = FakeBrain(error=RuntimeError("boom"))provider = FakeProvider([- RealtimeEvent(type="input_transcript", text="do it", is_final=True),+ RealtimeEvent(type="input_transcript", text="open the calculator", is_final=True),RealtimeEvent(type="tool_call",call_id="c-8",tool_name="jarvis_action",- tool_args={"request": "do it"},+ tool_args={"request": "open the calculator"},),])@@ -7090,6 +7109,12 @@ async def test_presence_check_during_pending_action_gets_status_line_not_providegate = asyncio.Event() # never set: the delegated action outlives the testbrain = FakeBrain(gate=gate)jsons = []+ # The first utterance must be one that genuinely delegates. The live+ # incident's own sentence was a question, and since the native/native+ # rejection (2026-08-19) a question no longer opens a delegate at all —+ # so the fixture stopped setting up the very state it is about. What is+ # under test is the PROBE during a pending action, not which sentence+ # started it.# The live shape (2026-07-17 09:23): the provider itself called# jarvis_action, the user barged into the silent wait, and only then did# the probe's final transcript arrive on a fresh turn.@@ -7097,14 +7122,14 @@ async def test_presence_check_during_pending_action_gets_status_line_not_provide[RealtimeEvent(type="input_transcript",- text="Can I just buy it like that?",+ text="Open the calculator.",is_final=True,),RealtimeEvent(type="tool_call",call_id="call-1",tool_name="jarvis_action",- tool_args={"request": "Can I just buy it like that?"},+ tool_args={"request": "Open the calculator."},),RealtimeEvent(type="interrupted"),RealtimeEvent(@@ -7124,9 +7149,10 @@ async def test_presence_check_during_pending_action_gets_status_line_not_provideassert len(spoken) == 1pool = {text for texts in _DELEGATE_BRIDGE_TEXTS.values() for text in texts}assert spoken[0]["text"] in pool- # The probe itself never becomes a provider response or a brain turn:- # the single request belongs to the first (native) turn.- assert provider.session.response_requests == 1+ # The probe itself never becomes a provider response or a brain turn. The+ # first turn delegates, so it asks the provider for nothing either — the+ # only thing the user hears is the deterministic progress line above.+ assert provider.session.response_requests == 0assert all("hallo" not in call[0] for call in brain.calls)await sess.end(reason="test")diff --git a/tests/unit/skills/test_builtin_skills.py b/tests/unit/skills/test_builtin_skills.pyindex 3a7ab55c1c..dd66a9d465 100644--- a/tests/unit/skills/test_builtin_skills.py+++ b/tests/unit/skills/test_builtin_skills.py@@ -96,6 +96,7 @@ def test_expected_builtin_count() -> None:"skill-creator","control-api","cli-gcloud",+ "jarvis-doc-author",}assert base.issubset(set(BUILTIN_SKILL_NAMES)), (f"missing base skill(s): {base - set(BUILTIN_SKILL_NAMES)}"@@ -116,13 +117,14 @@ def test_every_bundled_plugin_skill_is_shipped() -> None:"""from jarvis.skills.builtin import BUILTIN_SKILLS_DIR- bundled = {- p.parent.name- for p in BUILTIN_SKILLS_DIR.glob("plugin-*/SKILL.md")- }+ # EVERY bundled directory, not just ``plugin-*``. The defect is the dead+ # bundle, and it does not care about the prefix: ``jarvis-doc-author``+ # shipped unlisted and unloadable for exactly as long as the narrower+ # version of this assertion was green (2026-08-20).+ bundled = {p.parent.name for p in BUILTIN_SKILLS_DIR.glob("*/SKILL.md")}unlisted = bundled - set(BUILTIN_SKILL_NAMES)assert not unlisted, (- f"bundled plugin skill(s) missing from BUILTIN_SKILL_NAMES: {unlisted}"+ f"bundled skill(s) missing from BUILTIN_SKILL_NAMES: {unlisted}")