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(tests): repair suite fallout from parallel device-auto-select + OpenRouter-TTS work

Ruben Lütkebd6b5cdbc453
diff --git a/jarvis/core/config_writer.py b/jarvis/core/config_writer.py
index fa2cb35e74..ffed3b5dbc 100644
--- a/jarvis/core/config_writer.py
+++ b/jarvis/core/config_writer.py
@@ -910,6 +910,19 @@ _TTS_DEFAULTS: dict[str, dict[str, str]] = {
"voice_en": "",
"language_code": "auto",
},
+ "openrouter-tts": {
+ # OpenRouter TTS reuses the shared OpenRouter key and resolves its own
+ # model + voice defaults internally (jarvis/plugins/tts/openrouter_tts.py:
+ # MODEL_DEFAULT_VOICE / GENERIC_DEFAULT_VOICE). Leave these blank — the
+ # falsy gate in _patch_tts_block skips empty values, so the provider picks
+ # sensible per-model defaults. This entry exists so the provider-parity
+ # test passes and set_tts_provider() can reconcile the [tts] block on a
+ # switch to OpenRouter TTS.
+ "model": "",
+ "voice_de": "",
+ "voice_en": "",
+ "language_code": "auto",
+ },
}
# Per-provider voice allowlist — when the existing voice does not match the
diff --git a/tests/unit/speech/test_idle_spawn_inflight.py b/tests/unit/speech/test_idle_spawn_inflight.py
index 8a593a6152..e7f87c49d6 100644
--- a/tests/unit/speech/test_idle_spawn_inflight.py
+++ b/tests/unit/speech/test_idle_spawn_inflight.py
@@ -65,6 +65,7 @@ def _make_active_session_pipeline(idle_timeout_s: float) -> SpeechPipeline:
pipe._ptt_mode = False
pipe._idle_timeout_s = idle_timeout_s
pipe._input_device = None
+ pipe._input_priority = ()
pipe._hangup_event = asyncio.Event()
pipe._session_end_reason = None
pipe._carry_pcm = bytearray()
diff --git a/tests/unit/speech/test_pipeline_push_to_talk.py b/tests/unit/speech/test_pipeline_push_to_talk.py
index 04653ad936..e19d60ebff 100644
--- a/tests/unit/speech/test_pipeline_push_to_talk.py
+++ b/tests/unit/speech/test_pipeline_push_to_talk.py
@@ -151,7 +151,7 @@ async def test_ptt_session_records_until_release_and_submits(monkeypatch):
# 5 chunks = 500 ms — comfortably over the 300 ms min-hold gate.
monkeypatch.setattr(
"jarvis.speech.pipeline.MicrophoneCapture",
- lambda device=None: _FakeMic(chunks=[_CHUNK_100MS] * 5),
+ lambda device=None, **kwargs: _FakeMic(chunks=[_CHUNK_100MS] * 5),
)
captured: dict[str, object] = {}
@@ -184,7 +184,7 @@ async def test_ptt_session_short_tap_submits_nothing(monkeypatch):
# One 100 ms chunk, then immediate release → below the 300 ms gate.
monkeypatch.setattr(
"jarvis.speech.pipeline.MicrophoneCapture",
- lambda device=None: _FakeMic(chunks=[_CHUNK_100MS]),
+ lambda device=None, **kwargs: _FakeMic(chunks=[_CHUNK_100MS]),
)
handled = {"called": False}
@@ -206,7 +206,7 @@ async def test_ptt_session_hangup_during_hold_returns_hotkey(monkeypatch):
pipe._ptt_mode = True
monkeypatch.setattr(
"jarvis.speech.pipeline.MicrophoneCapture",
- lambda device=None: _FakeMic(chunks=[_CHUNK_100MS] * 3),
+ lambda device=None, **kwargs: _FakeMic(chunks=[_CHUNK_100MS] * 3),
)
handled = {"called": False}
@@ -345,7 +345,7 @@ async def test_ptt_publishes_live_partials_while_holding(monkeypatch):
pipe._handle_utterance = _fake_handle # type: ignore[method-assign]
monkeypatch.setattr(
"jarvis.speech.pipeline.MicrophoneCapture",
- lambda device=None: _FakeMic(chunks=[_CHUNK_100MS] * 10), # ~1s buffered
+ lambda device=None, **kwargs: _FakeMic(chunks=[_CHUNK_100MS] * 10), # ~1s buffered
)
async def _release_later() -> None:
@@ -378,7 +378,7 @@ async def test_ptt_live_feed_disabled_when_interval_zero(monkeypatch):
pipe._handle_utterance = _fake_handle # type: ignore[method-assign]
monkeypatch.setattr(
"jarvis.speech.pipeline.MicrophoneCapture",
- lambda device=None: _FakeMic(chunks=[_CHUNK_100MS] * 10),
+ lambda device=None, **kwargs: _FakeMic(chunks=[_CHUNK_100MS] * 10),
)
async def _release_later() -> None: