Skip to content

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.

fix(portability): reconcile provider defaults and native test seams

rubenluetke10-beep43c3b0fac80e
diff --git a/jarvis/core/config_writer.py b/jarvis/core/config_writer.py
index 0a94140f13..d312192f3f 100644
--- a/jarvis/core/config_writer.py
+++ b/jarvis/core/config_writer.py
@@ -1962,6 +1962,12 @@ _TTS_DEFAULTS: dict[str, dict[str, str]] = {
"voice_en": "Charon",
"language_code": "de-DE",
},
+ "vertex-tts": {
+ "model": "gemini-3.1-flash-tts-preview",
+ "voice_de": "Charon",
+ "voice_en": "Charon",
+ "language_code": "de-DE",
+ },
"grok-voice": {
# model is ignored by the Grok plugin (no model param in GrokVoiceTTS).
# voice from jarvis/plugins/tts/grok_voice_tts.py: GROK_VOICE_LEO = "leo"
diff --git a/tests/contract/test_browser_live.py b/tests/contract/test_browser_live.py
index b347250fdb..4a12266962 100644
--- a/tests/contract/test_browser_live.py
+++ b/tests/contract/test_browser_live.py
@@ -84,6 +84,10 @@ class PageHandler(BaseHTTPRequestHandler):
return cls.requests_ready.wait_for(lambda: path in cls.page_requests, timeout=15)
def _respond(self):
+ if self.path == "/ready":
+ self.send_response(204)
+ self.end_headers()
+ return
if self.path.startswith(("/login", "/account")):
signed_in = "fixture_session=verified" in self.headers.get("Cookie", "")
self.profile_requests.append((self.path, signed_in))
@@ -114,7 +118,8 @@ class PageHandler(BaseHTTPRequestHandler):
<h1 id="counter">0</h1>
<script>let n=0;function paint(){document.querySelector('#counter').textContent=++n;
document.body.style.background=n%2?'#fdd':'#ddf';requestAnimationFrame(paint)}
- requestAnimationFrame(paint)</script>"""
+ requestAnimationFrame(paint);
+ requestAnimationFrame(()=>requestAnimationFrame(()=>fetch('/ready')))</script>"""
self.send_response(200)
self.send_header("Content-Type", "text/html")
self.end_headers()
@@ -195,7 +200,7 @@ async def _open_animation_and_hand_back(live, session, queue, site):
await _control(live, session, "viewer", "navigate", {"url": site})
# Native navigation acknowledges input, not page load. Handing back at
# that point can close Chrome before it has navigated away from New Tab.
- assert await asyncio.to_thread(PageHandler.wait_for_path, "/"), "Fixture page did not load"
+ assert await asyncio.to_thread(PageHandler.wait_for_path, "/ready"), "Fixture did not render"
await _control(live, session, "viewer", "takeover", {"enabled": False})
async with asyncio.timeout(15):
while True:
@@ -288,16 +293,19 @@ async def test_native_chrome_toolbar_keyboard_and_agent_handoff(live, site):
async with asyncio.timeout(15):
# A plain Chrome sign-in deliberately exposes no DOM or URL.
# HTTP arrival proves native toolbar input reached the fixture.
- assert await asyncio.to_thread(PageHandler.wait_for_path, "/")
+ assert await asyncio.to_thread(PageHandler.wait_for_path, "/ready")
except TimeoutError:
pytest.fail(f"Native browser did not select the navigated tab: {session.state}")
await _control(live, session, "viewer", "takeover", {"enabled": False})
- async with asyncio.timeout(15):
- while True:
- event = await queue.get()
- if (event["kind"] == "state" and not event["manual"]
- and event["url"].rstrip("/") == site):
- break
+ try:
+ async with asyncio.timeout(15):
+ while True:
+ event = await queue.get()
+ if (event["kind"] == "state" and not event["manual"]
+ and event["url"].rstrip("/") == site):
+ break
+ except TimeoutError:
+ pytest.fail(f"Handback did not restore the selected tab: {session.state}")
assert len(event["tabs"]) >= 2
assert event["url"].rstrip("/") == site
finally:
diff --git a/tests/fakes/voice_scenario.py b/tests/fakes/voice_scenario.py
index 245a26261e..8f7a2493bf 100644
--- a/tests/fakes/voice_scenario.py
+++ b/tests/fakes/voice_scenario.py
@@ -134,6 +134,8 @@ class ScenarioResult:
class _ScenarioBridge:
"""Tool bridge that answers exactly what the scenario scripted."""
+ has_pending_confirmation = False
+
def __init__(self, tools: list[ScenarioTool]) -> None:
self._by_name = {tool.name: tool for tool in tools}
self.declarations = tuple(
diff --git a/tests/integration/test_launcher_headless.py b/tests/integration/test_launcher_headless.py
index 60fd08ef33..2e8cadb00d 100644
--- a/tests/integration/test_launcher_headless.py
+++ b/tests/integration/test_launcher_headless.py
@@ -15,7 +15,6 @@ from types import SimpleNamespace
import pytest
-
# ---------------------------------------------------------------------------
# Lightweight fakes shared by all stubs below
# ---------------------------------------------------------------------------
@@ -27,12 +26,21 @@ class _FakeBus:
def subscribe(self, *args: object, **kwargs: object) -> None:
pass
+ def subscribe_all(self, *args: object, **kwargs: object) -> None:
+ pass
+
+ def unsubscribe_all(self, *args: object, **kwargs: object) -> None:
+ pass
+
+ def unsubscribe(self, *args: object, **kwargs: object) -> None:
+ pass
+
async def publish(self, event: object) -> None:
pass
class _FakeState:
- """Nimmt beliebige Attribut-Zuweisung (mirrors Starlette State)."""
+ """Accept arbitrary attributes, like Starlette State."""
class _FakeApp:
@@ -46,14 +54,14 @@ class _FakeApp:
# ---------------------------------------------------------------------------
-# Mock WebServer — zentrales Lifecycle-Testsubjekt
+# Fake WebServer: the central lifecycle test subject
# ---------------------------------------------------------------------------
class _MockWebServer:
"""Stand-in for jarvis.ui.web.server.WebServer."""
- instances: list["_MockWebServer"] = []
+ instances: list[_MockWebServer] = []
def __init__(self, cfg):
self.cfg = cfg
diff --git a/tests/unit/agents/test_node_status_parity.py b/tests/unit/agents/test_node_status_parity.py
index 037f457fc0..c2dbe186aa 100644
--- a/tests/unit/agents/test_node_status_parity.py
+++ b/tests/unit/agents/test_node_status_parity.py
@@ -46,11 +46,12 @@ def _ts_node_statuses() -> set[str]:
def _board_status_labels() -> set[str]:
text = _BOARD.read_text(encoding="utf-8")
match = re.search(
- r"const STATUS_LABEL: Record<[^>]+> = \{(.*?)\n\};",
+ r"const STATUS_TONE: Record<[^>]+> = \{(.*?)\n\};",
text,
flags=re.DOTALL,
)
- assert match is not None, "DepartureBoard STATUS_LABEL map is missing"
+ assert match is not None, "DepartureBoard STATUS_TONE map is missing"
+ assert 't(`subagents_view.status.${agent.status}`)' in text
return set(re.findall(r"^\s{2}([a-z_]+):", match.group(1), flags=re.MULTILINE))
diff --git a/tests/unit/brain/test_model_catalog.py b/tests/unit/brain/test_model_catalog.py
index 82bee24942..24c3f8c537 100644
--- a/tests/unit/brain/test_model_catalog.py
+++ b/tests/unit/brain/test_model_catalog.py
@@ -83,7 +83,7 @@ class TestProviderCatalog:
def test_stt_providers_select_a_model(self) -> None:
# Local "faster-whisper" was removed as a user-selectable STT provider
# (v1.0.1); the cloud STT providers still each expose a model list.
- for p in ("groq-api", "openai-api", "deepgram"):
+ for p in ("groq-api", "openai-api", "deepgram-api"):
spec = catalog_spec(p)
assert spec is not None, p
assert spec.tier == "stt"
@@ -103,7 +103,7 @@ class TestProviderCatalog:
@pytest.mark.asyncio
async def test_list_models_for_stt_returns_models(self, tmp_path: Path) -> None:
cat = ModelCatalog(cache_path=tmp_path / "c.json")
- result = await cat.list_models("deepgram")
+ result = await cat.list_models("deepgram-api")
assert result.selects == "model"
assert any("nova" in m.id for m in result.models)
diff --git a/tests/unit/brain/test_router_tool_entrypoint_parity.py b/tests/unit/brain/test_router_tool_entrypoint_parity.py
index dac8d5b9f4..4995152166 100644
--- a/tests/unit/brain/test_router_tool_entrypoint_parity.py
+++ b/tests/unit/brain/test_router_tool_entrypoint_parity.py
@@ -38,6 +38,7 @@ INTERNAL_ONLY: dict[str, str] = {
# Attached by the router only when a turn is about the screen
# (jarvis/brain/vision_gate.py), so it is not a static ROUTER_TOOLS member.
"screenshot": "gated per-turn by the vision gate",
+ "live-screen-snapshot": "added as screen_snapshot by the live ToolGateway",
}
diff --git a/tests/unit/commands/test_registry_parity.py b/tests/unit/commands/test_registry_parity.py
index 8b34fbd792..fa9ddbec4d 100644
--- a/tests/unit/commands/test_registry_parity.py
+++ b/tests/unit/commands/test_registry_parity.py
@@ -144,7 +144,8 @@ def test_realtime_switch_exposes_experimental_acknowledgement() -> None:
properties = command.params["properties"]
# Removed 2026-08-10 with its adapter — the enum must not offer it.
assert "codex-subscription-realtime" not in properties["provider"]["enum"]
- assert "openai-realtime" in properties["provider"]["enum"]
+ assert "openai-live" in properties["provider"]["enum"]
+ assert "openai-realtime" not in properties["provider"]["enum"]
assert properties["accept_experimental"] == {
"type": "boolean",
"default": False,
diff --git a/tests/unit/computers/test_authorize_key.py b/tests/unit/computers/test_authorize_key.py
index 2b510eece5..3715351232 100644
--- a/tests/unit/computers/test_authorize_key.py
+++ b/tests/unit/computers/test_authorize_key.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+import os
import shutil
import subprocess
from pathlib import Path
@@ -21,8 +22,12 @@ OLD_KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIold"
def _run(home: Path) -> None:
subprocess.run( # noqa: S603 — fixed argv
[str(SH), "-c", authorize_key_command(NEW_KEY)],
- env={"HOME": str(home), "PATH": str(Path(str(SH)).parent)},
+ env={
+ "HOME": str(home),
+ "PATH": os.pathsep.join((str(Path(str(SH)).parent), os.defpath)),
+ },
check=True,
+ encoding="utf-8",
creationflags=NO_WINDOW_CREATIONFLAGS,
)
diff --git a/tests/unit/core/test_colour_env.py b/tests/unit/core/test_colour_env.py
index 18396c8d94..bfeddf6be5 100644
--- a/tests/unit/core/test_colour_env.py
+++ b/tests/unit/core/test_colour_env.py
@@ -91,7 +91,7 @@ def test_sanitizing_a_clean_environment_is_a_no_op(
def _main_stopped_at_arg_parsing(monkeypatch: pytest.MonkeyPatch) -> None:
- """Run ``launcher.main`` up to the first thing that follows the drop.
+ """Run the boot body up to the first thing that follows the drop.
Stopping at ``_parse_args`` is the assertion: everything the app does with
its environment happens after it, so a drop that still ran is a drop that
@@ -107,7 +107,7 @@ def _main_stopped_at_arg_parsing(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(launcher, "_parse_args", _stop)
with pytest.raises(RuntimeError, match="argument parsing reached"):
- launcher.main([])
+ launcher._main([])
def test_start_up_drops_the_claims_before_anything_else_runs(
diff --git a/tests/unit/cu/test_engine_loop.py b/tests/unit/cu/test_engine_loop.py
index f99f5c9616..19722024af 100644
--- a/tests/unit/cu/test_engine_loop.py
+++ b/tests/unit/cu/test_engine_loop.py
@@ -19,6 +19,7 @@ pytest.importorskip("PIL", reason="pillow required for frame handling")
import jarvis.cu.engine as engine_mod
from jarvis.cu.capture import VisualProbe, capture_stable_frame
from jarvis.cu.geometry import MonitorInfo
+from tests.fakes.fake_permission_service import FakePermissionService
MONITOR = MonitorInfo(left=0, top=0, width=192, height=108)
@@ -91,6 +92,9 @@ def _solid(shade: int = 30) -> tuple[tuple[int, int], bytes]:
@pytest.fixture
def patched(monkeypatch, tmp_path):
"""Patch every OS touchpoint of the engine to deterministic fakes."""
+ gate = FakePermissionService()
+ monkeypatch.setattr(engine_mod, "_permission_gate", lambda: gate)
+ monkeypatch.setattr(engine_mod, "_frontmost_system_consent_owner", lambda: "")
state = SimpleNamespace(
screen_shade=30,
typed_lands=True, # bool, or a list popped per verify call
diff --git a/tests/unit/dictation/test_dictate_keybind.py b/tests/unit/dictation/test_dictate_keybind.py
index 0166e4ca6d..9ef4630c16 100644
--- a/tests/unit/dictation/test_dictate_keybind.py
+++ b/tests/unit/dictation/test_dictate_keybind.py
@@ -569,7 +569,10 @@ class _StubSTT:
@pytest.mark.asyncio
async def test_start_dictation_records_the_requested_target() -> None:
+ from tests.fakes.fake_permission_service import FakePermissionService
+
pipe = SpeechPipeline.__new__(SpeechPipeline)
+ pipe._permission_gate = FakePermissionService()
pipe._utterance_stt = _StubSTT()
pipe._dictation_task = None
pipe._dictation_stop_event = asyncio.Event()
diff --git a/tests/unit/plugins/stt/test_dictionary_bias_opt_out.py b/tests/unit/plugins/stt/test_dictionary_bias_opt_out.py
index b4b4d614ec..0f23b78993 100644
--- a/tests/unit/plugins/stt/test_dictionary_bias_opt_out.py
+++ b/tests/unit/plugins/stt/test_dictionary_bias_opt_out.py
@@ -32,6 +32,7 @@ def _cloud_provider(monkeypatch: pytest.MonkeyPatch) -> type[_RecordingProvider]
_RecordingProvider.built = []
monkeypatch.setattr(stt_plugins, "_resolve_effective_stt", lambda name: (name, ""))
monkeypatch.setattr(stt_plugins, "_load_provider_class", lambda name: _RecordingProvider)
+ monkeypatch.setattr("jarvis.core.config.get_provider_secret", lambda _: "fixture-key")
monkeypatch.setattr(
dictionary, "dictionary_bias_words", lambda *_a, **_k: ["GitHub", "Agentic IDE"]
)
diff --git a/tests/unit/plugins/test_create_skill_tool.py b/tests/unit/plugins/test_create_skill_tool.py
index d7309e6137..db3b7b45b4 100644
--- a/tests/unit/plugins/test_create_skill_tool.py
+++ b/tests/unit/plugins/test_create_skill_tool.py
@@ -170,7 +170,7 @@ async def test_writes_a_brain_authored_draft_skill(registry, skills_root) -> Non
assert any("youtube_music" in step for step in out["steps_preview"])
assert provider.calls == 1
- skill = registry.get("Morgenroutine")
+ skill = registry.get("morgenroutine")
assert skill.state == SkillLifecycleState.DRAFT # AP-15: never auto-active
on_disk = (skills_root / "morgenroutine" / "SKILL.md").read_text(encoding="utf-8")
assert "state: draft" in on_disk
diff --git a/tests/unit/realtime/test_lookup_never_reports_done.py b/tests/unit/realtime/test_lookup_never_reports_done.py
index 5834e6065a..0ff796d0dc 100644
--- a/tests/unit/realtime/test_lookup_never_reports_done.py
+++ b/tests/unit/realtime/test_lookup_never_reports_done.py
@@ -245,10 +245,10 @@ def test_a_plain_string_payload_is_read() -> None:
def test_the_fact_list_is_bounded() -> None:
rows = [
- {"title": f"Hit {index}", "snippet": "x" * 900, "url": ""}
- for index in range(20)
+ {"title": f"Hit {index}", "snippet": "x" * 9000, "url": ""}
+ for index in range(60)
]
facts = _lookup_facts([("search_web", _search_result(rows))])
- assert len(facts["retrieved"]) <= 5
- assert all(len(item) <= 320 for item in facts["retrieved"])
+ assert len(facts["retrieved"]) == 50
+ assert all(len(item) <= 4000 for item in facts["retrieved"])
diff --git a/tests/unit/setup/test_macos_app_bundle.py b/tests/unit/setup/test_macos_app_bundle.py
index ada7f248b5..67b11f837b 100644
--- a/tests/unit/setup/test_macos_app_bundle.py
+++ b/tests/unit/setup/test_macos_app_bundle.py
@@ -806,7 +806,7 @@ def test_a_changed_interpreter_still_earns_a_fresh_rebuild(tmp_path: Path, monke
{
"cdhash": "cdhash-one",
"install_root": str((tmp_path / "install").resolve()),
- "python": "3.11",
+ "python": f"{sys.version_info.major}.{sys.version_info.minor + 1}",
"machine": platform.machine(),
},
sort_keys=True,
@@ -833,9 +833,7 @@ def test_a_changed_interpreter_still_earns_a_fresh_rebuild(tmp_path: Path, monke
)[1],
)
- # The recorded note carries Python 3.11; this interpreter is a different
- # minor version, so a fresh build genuinely can produce a different app.
- assert f"{sys.version_info.major}.{sys.version_info.minor}" != "3.11"
+ # The recorded note deliberately differs from this runner's interpreter.
ensure_macos_app_bundle(
install_dir=tmp_path / "install",
applications_dir=tmp_path / "Applications",
diff --git a/tests/unit/test_provider_spec.py b/tests/unit/test_provider_spec.py
index 032c9f4021..3f8909a3ac 100644
--- a/tests/unit/test_provider_spec.py
+++ b/tests/unit/test_provider_spec.py
@@ -222,13 +222,13 @@ def test_gemini_offers_both_aistudio_and_vertex() -> None:
assert alt.dashboard_url and "cloud.google.com" in alt.dashboard_url
-def test_non_gemini_providers_have_no_alt_credential() -> None:
- """Only the Gemini family carries the AI-Studio-vs-Vertex split today (the
- brain, the Flash-TTS voice, and the Gemini Live realtime provider all bill
- the same Google account); every other provider keeps a single credential
- path (alt_credential is None)."""
+def test_other_families_have_no_google_project_credential_path() -> None:
+ """The Google family offers key and Cloud project paths across surfaces."""
for spec in PROVIDERS:
- if spec.id in ("gemini", "gemini-flash-tts", "gemini-live"):
+ if spec.id in (
+ "gemini", "gemini-api", "gemini-flash-tts", "gemini-live",
+ "vertex", "vertex-stt", "vertex-tts", "vertex-live",
+ ):
continue
assert spec.alt_credential is None, f"{spec.id}: unexpected alt_credential"
diff --git a/tests/unit/test_tts_defaults_parity.py b/tests/unit/test_tts_defaults_parity.py
index 8507f5dd5a..b73a069cda 100644
--- a/tests/unit/test_tts_defaults_parity.py
+++ b/tests/unit/test_tts_defaults_parity.py
@@ -11,10 +11,28 @@ matching _TTS_DEFAULTS entry, and PASS once the entry is added.
"""
from __future__ import annotations
+import tomllib
+
from jarvis.core import config_writer
from jarvis.ui.web.provider_spec import PROVIDERS
+def test_vertex_switch_replaces_the_previous_providers_model_and_voices(tmp_path, monkeypatch):
+ monkeypatch.setattr(
+ config_writer, "_sync_tts_provider_drift_soll", lambda applied: None, # i18n-allow
+ )
+ path = tmp_path / "config.toml"
+ path.write_text(
+ '[tts]\nprovider = "openrouter-tts"\nmodel = "old-model"\n'
+ 'voice_de = "old-voice"\nvoice_en = "old-voice"\n', encoding="utf-8",
+ )
+ config_writer.set_tts_provider("vertex-tts", path=path)
+ tts = tomllib.loads(path.read_text(encoding="utf-8"))["tts"]
+ assert tts["provider"] == "vertex-tts"
+ assert tts["model"] == "gemini-3.1-flash-tts-preview"
+ assert tts["voice_de"] == tts["voice_en"] == "Charon"
+
+
def test_all_tts_providers_have_defaults_entry() -> None:
"""Every provider with tier=='tts' must have a key in _TTS_DEFAULTS.
diff --git a/tests/unit/ui/web/test_skills_routes.py b/tests/unit/ui/web/test_skills_routes.py
index 71b4fbb9df..9037940f25 100644
--- a/tests/unit/ui/web/test_skills_routes.py
+++ b/tests/unit/ui/web/test_skills_routes.py
@@ -417,7 +417,7 @@ def test_creator_author_writes_a_draft_skill_with_a_brain(skills_root: Path) ->
assert res.status_code == 200, res.text
body = res.json()
assert body["brain_used"] is True
- assert body["skill"]["name"] == "Mail Morgen"
+ assert body["skill"]["name"] == "mail-morgen"
assert body["skill"]["state"] == "draft" # AP-15
crons = [t["cron"] for t in body["draft"]["triggers"] if t["type"] == "schedule"]
assert crons == ["0 6 * * *"]
diff --git a/tests/unit/web/test_local_only_install_has_every_tier.py b/tests/unit/web/test_local_only_install_has_every_tier.py
index c02e7b68cc..8b3de2599d 100644
--- a/tests/unit/web/test_local_only_install_has_every_tier.py
+++ b/tests/unit/web/test_local_only_install_has_every_tier.py
@@ -99,7 +99,7 @@ def test_a_self_hosted_card_says_where_its_server_lives() -> None:
)
-def test_the_dictation_card_follows_the_server_the_user_configured() -> None:
+def test_the_dictation_card_follows_the_server_the_user_configured(monkeypatch) -> None:
"""The concrete case behind the rule above: a user who moved their Ollama
to another box used to keep a second, invisible copy of the address here,
pinned to localhost, and dictation polish silently talked to nothing."""
@@ -107,22 +107,17 @@ def test_the_dictation_card_follows_the_server_the_user_configured() -> None:
from jarvis.dictation.polish_client import POLISH_FAMILIES
family = next(f for f in POLISH_FAMILIES if f.endpoint_provider)
- import jarvis.core.config as cfg
+ from tests.fakes.provider_config import install_provider_config
conf = JarvisConfig(
brain=BrainConfig(
providers={"ollama": BrainProviderConfig(base_url="http://gpu.lan:11434")}
)
)
- original = cfg.load_config
- cfg.load_config = lambda: conf # type: ignore[assignment]
- try:
- assert family.effective_base_url == "http://gpu.lan:11434/v1"
- # And a server on another machine is keyless but NOT on-device — the
- # privacy promise has to follow the address, not the billing model.
- assert family.runs_on_device is False
- finally:
- cfg.load_config = original # type: ignore[assignment]
+ install_provider_config(monkeypatch, conf)
+ assert family.effective_base_url == "http://gpu.lan:11434/v1"
+ # A server on another machine is keyless but not on-device.
+ assert family.runs_on_device is False
def test_the_realtime_tier_keeps_a_self_hosted_option() -> None: