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.

chore: auto-save WIP via Claude stop-hook safety net (2026-07-01 13:52)

Ruben Lütke6c39032e58d8
diff --git a/tests/unit/speech/test_rolling_whisper_wake_quiet_mic.py b/tests/unit/speech/test_rolling_whisper_wake_quiet_mic.py
index 9501216474..6bd9a535e5 100644
--- a/tests/unit/speech/test_rolling_whisper_wake_quiet_mic.py
+++ b/tests/unit/speech/test_rolling_whisper_wake_quiet_mic.py
@@ -13,9 +13,11 @@ import asyncio
import re
import numpy as np
+import pytest
from jarvis.core.protocols import AudioChunk, Transcript
from jarvis.speech.rolling_whisper_wake import RollingWhisperWake
+from jarvis.speech.wake_phrase import compile_wake_matcher
def _const_chunk(value: int, n: int = 1600) -> AudioChunk:
@@ -85,3 +87,42 @@ async def test_very_quiet_wake_below_legacy_peak_gate_reaches_whisper() -> None:
await feeder
except (asyncio.CancelledError, Exception): # noqa: BLE001, S110
pass
+
+
+ ("phrase", "transcript"),
+ [
+ ("Hey Ruben", "hey ruben"),
+ ("Hey Nico", "hey nico"),
+ ("Computer", "computer"),
+ ],
+)
+async def test_three_custom_wakes_trigger_at_quiet_mic_volume(
+ phrase: str, transcript: str
+) -> None:
+ """Done-gate: >= 3 DIFFERENT custom wake words all trigger at NORMAL-but-quiet
+ speaking volume (window peak ~0.009) through the real phrase matcher — the
+ "no shouting" contract, verified word-agnostically for the whole set."""
+ stt = _PhraseSTT(transcript)
+ wake = RollingWhisperWake(
+ stt,
+ pattern=compile_wake_matcher(phrase),
+ poll_interval_s=0.01,
+ cooldown_s=0.0,
+ save_debug_wavs=False,
+ )
+ src: asyncio.Queue = asyncio.Queue()
+ stop = asyncio.Event()
+ feeder = asyncio.create_task(_feed_until(src, stop, _const_chunk(295))) # peak ~0.009
+ try:
+ kw = await asyncio.wait_for(_first_keyword(wake, src), timeout=3.0)
+ assert kw, f"{phrase!r} did not wake at quiet volume"
+ assert stt.calls >= 1, f"{phrase!r} window never reached Whisper"
+ finally:
+ stop.set()
+ await src.put(None)
+ feeder.cancel()
+ try:
+ await feeder
+ except (asyncio.CancelledError, Exception): # noqa: BLE001, S110
+ pass