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.

feat(wake): a wake word requires a local model — no branded fallback, else hotkey-only

Ruben Lütkeacd9ca00a293
diff --git a/jarvis/speech/pipeline.py b/jarvis/speech/pipeline.py
index e41eca008e..bb3f6a507f 100644
--- a/jarvis/speech/pipeline.py
+++ b/jarvis/speech/pipeline.py
@@ -1686,7 +1686,26 @@ class SpeechPipeline:
except Exception as exc: # noqa: BLE001 — degrade, never crash the switch
log.warning("Wake-Live-Switch: local Whisper build failed: %s", exc)
- if engine in ("openwakeword", "custom_onnx"):
+ if not getattr(plan, "wake_available", True):
+ # No local model for the user's OWN word — arm NO detector. This is
+ # the explicit, honest "wake off, use the hotkey" mode (product rule
+ # 2026-07-04), NOT a dead listener: the user activates via hotkey /
+ # push-to-talk. Do NOT fall back to the bundled branded 'Hey Rhasspy'
+ # model — listening for a word the user never says is the bug we are
+ # removing. Installing the local speech pack (any word) or a custom
+ # .onnx re-arms the wake via a later set_wake_plan.
+ self._openwakeword_enabled = False
+ self._whisper_wake_enabled = False
+ if self._whisper_wake is not None and self._wake_matcher is not None:
+ self._whisper_wake._pattern = self._wake_matcher # noqa: SLF001
+ log.info(
+ "Wake-Live-Switch: no local model for %r — wake word OFF; "
+ "hotkey / push-to-talk is the activation. Install the local "
+ "speech pack (works for any word) or supply a custom .onnx to "
+ "enable the wake word.",
+ self._wake_phrase_label,
+ )
+ elif engine in ("openwakeword", "custom_onnx"):
self._wake = OpenWakeWordProvider(
keywords=(plan.oww_keyword,),
activation_threshold=plan.threshold,
@@ -1714,33 +1733,22 @@ class SpeechPipeline:
)
self._whisper_wake_enabled = True
else:
- # No local Whisper could be built: rather than disable BOTH
- # detectors — a SILENT DEAD LISTENER that only an app restart
- # could recover ("Hey/Neko sometimes stops waking entirely") —
- # fall back to the bundled hey_rhasspy OWW model so the wake path
- # stays ALIVE. The user keeps a working wake word (the neutral
- # offline phrase "Hey Rhasspy") instead of a dead custom one, and
- # a later set_wake_plan with a buildable Whisper re-arms the
- # custom phrase. AP-22 + the mission's "no dead state blocks
- # waking": a missing capability must degrade, never brick.
- from jarvis.speech.wake_constants import resolve_oww_model_path
-
- rhasspy_path = resolve_oww_model_path("hey_rhasspy")
- self._wake = OpenWakeWordProvider(
- keywords=("hey_rhasspy",),
- activation_threshold=getattr(
- plan, "threshold", PRODUCTION_WAKE_THRESHOLD
- ),
- model_path=rhasspy_path,
- )
- self._openwakeword_enabled = True
+ # stt_match was requested but the local Whisper engine could not
+ # be built. Product rule (2026-07-04): do NOT fall back to a
+ # branded 'Hey Rhasspy' model (listening for a word the user never
+ # says). Arm NO detector — the wake word is OFF and the honest
+ # activation is the hotkey / push-to-talk. This is an explicit,
+ # user-visible mode, not a silent dead listener; installing or
+ # repairing the local speech pack re-arms the custom phrase via a
+ # later set_wake_plan.
+ self._openwakeword_enabled = False
self._whisper_wake_enabled = False
log.warning(
"Wake-Live-Switch: stt_match requested but no local Whisper "
- "could be built — degrading to the bundled 'Hey Rhasspy' "
- "offline model so the wake stays alive (say 'Hey Rhasspy'). "
- "Install the [desktop] extra or supply a custom .onnx to use "
- "the custom phrase."
+ "could be built for %r — wake word OFF; use the hotkey / "
+ "push-to-talk. Install or repair the local speech pack (works "
+ "for any word) or supply a custom .onnx to enable it.",
+ self._wake_phrase_label,
)
log.info(
diff --git a/jarvis/speech/wake_phrase.py b/jarvis/speech/wake_phrase.py
index 2ca543e190..6e5a569b70 100644
--- a/jarvis/speech/wake_phrase.py
+++ b/jarvis/speech/wake_phrase.py
@@ -318,6 +318,13 @@ class WakeWordPlan:
# discriminator, and the STT would mis-transcribe the foreign brand word
# and wrongly reject valid hits.
verify_prefix: bool
+ # Product rule (2026-07-04): a wake word REQUIRES a local model that matches
+ # the user's OWN chosen word. When no such model is available (no custom
+ # ONNX, no local Whisper) we do NOT silently substitute a branded fallback
+ # model — we return wake_available=False so the app arms NO detector and the
+ # honest alternative is hotkey / push-to-talk activation. True for every
+ # real engine (custom_onnx / openwakeword / stt_match).
+ wake_available: bool = True
def _read(cfg: Any, name: str, default: Any) -> Any:
@@ -455,29 +462,31 @@ def resolve_wake_plan(cfg: Any, *, local_whisper_available: bool) -> WakeWordPla
verify_prefix=matcher.is_jarvis_default,
)
- # 4. Graceful degrade — fall back to the bundled hey_rhasspy model (neutral
- # offline fallback that ships without any product-name association). The
- # hey_rhasspy model is its own discriminator, so the German-pinned STT prefix
- # verifier must NOT run (verify_prefix=False): applying it would reject valid
- # hits because the STT transcribes the rhasspy sound differently from "Jarvis".
- rhasspy_path = resolve_oww_model_path("hey_rhasspy")
- _phrase_label = phrase or "Hey Rhasspy"
+ # 4. No local model for the user's OWN word. The product rule (2026-07-04)
+ # forbids silently substituting a branded fallback (the old 'Hey Rhasspy'
+ # degrade made the app listen for a word the user never says). Instead we
+ # return wake_available=False: the app arms NO wake detector, and the honest
+ # alternative is hotkey / push-to-talk activation. The user's requested phrase
+ # is preserved; installing the local speech pack (works for ANY word) or
+ # supplying a custom .onnx is what makes the wake word actually fire.
+ _phrase_label = phrase or "your wake word"
return WakeWordPlan(
phrase=phrase,
- engine="openwakeword",
- oww_model_path=rhasspy_path,
- oww_keyword="hey_rhasspy",
+ engine="none",
+ oww_model_path=None,
+ oww_keyword=canonical,
threshold=threshold,
- matcher=compile_wake_matcher("Hey Rhasspy"),
+ matcher=matcher,
needs_local_whisper=False,
degraded=True,
message=(
- f"Wake phrase '{_phrase_label}' needs the local-Whisper extra ([desktop])"
- " or a custom ONNX model; falling back to the bundled 'Hey Rhasspy'"
- " offline model. Install [desktop] or supply a custom .onnx to use a"
- " different phrase."
+ f"Wake word '{_phrase_label}' needs a local model. Install the local "
+ "speech pack (works for any word) or supply a custom .onnx to enable "
+ "it. Until then the wake word is off — use the hotkey / push-to-talk "
+ "to start a voice turn."
),
- verify_prefix=False, # rhasspy model IS the discriminator; no prefix gate
+ verify_prefix=False,
+ wake_available=False,
)
diff --git a/jarvis/ui/desktop_app.py b/jarvis/ui/desktop_app.py
index 3219da46d0..454faf09c4 100644
--- a/jarvis/ui/desktop_app.py
+++ b/jarvis/ui/desktop_app.py
@@ -2181,7 +2181,14 @@ class DesktopApp:
local_whisper_available=_local_whisper_available,
)
from loguru import logger as _wlog
- if wake_plan.degraded:
+ if not wake_plan.wake_available:
+ _wlog.info(
+ "Wake-word OFF: no local model for {!r} — hotkey / push-to-talk "
+ "is the activation. {}",
+ wake_plan.phrase,
+ wake_plan.message,
+ )
+ elif wake_plan.degraded:
_wlog.warning("Wake-word degraded: {}", wake_plan.message)
else:
_wlog.info(
@@ -2347,12 +2354,18 @@ class DesktopApp:
# - stt_match (custom phrase, no pretrained model) -> the
# neural model can't detect the phrase, so OWW is OFF and the
# RollingWhisperWake transcript-match IS the wake path.
+ # - no local model for the user's word (wake_plan.wake_available
+ # False) -> arm NOTHING; hotkey / push-to-talk is the only
+ # activation. The product rule (2026-07-04): a wake word needs
+ # a local model, never a silent branded fallback.
enable_openwakeword=(
self.cfg.trigger.wake_word_enabled
+ and wake_plan.wake_available
and wake_plan.engine in ("openwakeword", "custom_onnx")
),
enable_whisper_wake=(
self.cfg.trigger.wake_word_enabled
+ and wake_plan.wake_available
and (
wake_plan.engine == "stt_match"
or self.cfg.trigger.heavy_local_whisper
diff --git a/jarvis/ui/web/settings_routes.py b/jarvis/ui/web/settings_routes.py
index 46f228d293..90de3556da 100644
--- a/jarvis/ui/web/settings_routes.py
+++ b/jarvis/ui/web/settings_routes.py
@@ -547,6 +547,9 @@ async def put_wake_word(body: WakeWordBody, request: Request) -> dict[str, objec
"engine": engine,
"resolved_engine": plan.engine,
"degraded": plan.degraded,
+ # False when no local model matches the user's word: the wake word is off
+ # and hotkey / push-to-talk is the activation (product rule 2026-07-04).
+ "wake_available": plan.wake_available,
"message": plan.message,
"persisted": persisted,
# When live-applied, the running pipeline already swapped the detector;
diff --git a/tests/unit/speech/test_wake_custom_model.py b/tests/unit/speech/test_wake_custom_model.py
index 542ac2ae16..42cdeb9a4e 100644
--- a/tests/unit/speech/test_wake_custom_model.py
+++ b/tests/unit/speech/test_wake_custom_model.py
@@ -145,9 +145,10 @@ def test_stale_custom_model_lets_pretrained_phrase_through(tmp_path) -> None:
assert plan.degraded is False
-def test_stale_custom_model_without_whisper_degrades_honestly(tmp_path) -> None:
- # Mismatching model + no local Whisper: fall through to the bundled
- # offline fallback with a clear message — never a silent dead listener.
+def test_stale_custom_model_without_whisper_is_hotkey_only(tmp_path) -> None:
+ # Mismatching model + no local Whisper: the wake word is OFF (hotkey-only,
+ # product rule 2026-07-04) with a clear message — never a silent branded
+ # fallback and never a dead listener.
from jarvis.speech.wake_phrase import resolve_wake_plan
model = tmp_path / "hey_nico.onnx"
@@ -156,8 +157,8 @@ def test_stale_custom_model_without_whisper_degrades_honestly(tmp_path) -> None:
_cfg(str(model), phrase="Hey Fable", engine="auto"),
local_whisper_available=False,
)
- assert plan.engine == "openwakeword"
- assert plan.oww_keyword == "hey_rhasspy"
+ assert plan.engine == "none"
+ assert plan.wake_available is False
assert plan.degraded is True
diff --git a/tests/unit/speech/test_wake_dead_state.py b/tests/unit/speech/test_wake_dead_state.py
index 3cefc9d24d..b6b2b01fcc 100644
--- a/tests/unit/speech/test_wake_dead_state.py
+++ b/tests/unit/speech/test_wake_dead_state.py
@@ -10,16 +10,17 @@ Two concrete permanent-dead-state paths found in the wake plumbing:
re-enabling a detector wakes it back up, in-app.
2. ``set_wake_plan(engine="stt_match")`` on a box where the local Whisper engine
- cannot be built used to disable BOTH detectors → the silent dead listener
- above. It must instead degrade to the bundled hey_rhasspy OWW model so the
- wake stays alive (AP-22: a missing capability must degrade, never brick).
+ cannot be built used to leave a permanently-parked dead listener. It must park
+ RECOVERABLY on ``_wake_reload_event`` (both detectors off = the honest
+ hotkey-only mode per the 2026-07-04 product rule, re-armable in-app by a later
+ ``set_wake_plan``), and must NOT fall back to a branded 'Hey Rhasspy' model
+ (listening for a word the user never says).
"""
from __future__ import annotations
import asyncio
from types import SimpleNamespace
-from jarvis.plugins.wake.openwakeword_provider import OpenWakeWordProvider
from jarvis.speech.pipeline import PipelineState, SpeechPipeline
from jarvis.speech.wake_phrase import resolve_wake_plan
@@ -90,10 +91,12 @@ def _shell_for_set_wake_plan() -> SpeechPipeline:
return pipe
-def test_set_wake_plan_stt_match_without_whisper_degrades_to_rhasspy(monkeypatch) -> None:
+def test_set_wake_plan_stt_match_without_whisper_is_hotkey_only(monkeypatch) -> None:
"""A live switch to a custom phrase on a box where the wake Whisper cannot be
- built must NOT disable both detectors (the silent dead listener). It degrades
- to the bundled hey_rhasspy OWW model so wake stays alive."""
+ built must NOT fall back to a branded 'Hey Rhasspy' model (product rule
+ 2026-07-04). It arms NO detector — wake OFF, hotkey/PTT activation — which is
+ a RECOVERABLE parked state (the wake loop parks on _wake_reload_event so a
+ later set_wake_plan re-arms it), not the old permanent dead listener."""
import jarvis.plugins.stt as stt_pkg
def _boom(*_a: object, **_k: object) -> object:
@@ -107,12 +110,10 @@ def test_set_wake_plan_stt_match_without_whisper_degrades_to_rhasspy(monkeypatch
pipe = _shell_for_set_wake_plan()
pipe.set_wake_plan(plan)
- # Wake must stay ALIVE — at least one detector enabled, never both off.
- assert pipe._wake_listening_enabled() is True
- assert pipe._openwakeword_enabled is True
+ # No branded fallback: both detectors off (honest hotkey-only mode). This is
+ # recoverable, not dead — the wake loop parks on _wake_reload_event.
+ assert pipe._openwakeword_enabled is False
assert pipe._whisper_wake_enabled is False
- assert isinstance(pipe._wake, OpenWakeWordProvider)
- assert pipe._wake._keywords == ("hey_rhasspy",) # neutral offline fallback
def test_set_wake_plan_stt_match_with_whisper_uses_rolling_wake(monkeypatch) -> None:
diff --git a/tests/unit/speech/test_wake_live_apply.py b/tests/unit/speech/test_wake_live_apply.py
index 03fd1b33b4..49cd9426a7 100644
--- a/tests/unit/speech/test_wake_live_apply.py
+++ b/tests/unit/speech/test_wake_live_apply.py
@@ -98,14 +98,13 @@ def test_verify_prefix_false_for_stt_match_custom_name() -> None:
assert plan.verify_prefix is False
-def test_degraded_fallback_to_rhasspy_neutral_model() -> None:
- # Trademark neutralization (wake_phrase.py step 4): an unknown phrase
- # without local Whisper degrades to the bundled, product-name-neutral
- # ``hey_rhasspy`` model — which is its own discriminator, so the STT
- # prefix verifier must NOT run (verify_prefix=False).
+def test_unknown_phrase_without_model_is_hotkey_only() -> None:
+ # Product rule (2026-07-04): an unknown phrase without a local model does NOT
+ # degrade to a branded 'Hey Rhasspy' model — the wake word is OFF and the
+ # user activates via hotkey / push-to-talk. No detector is armed.
plan = resolve_wake_plan(_cfg(phrase="Computer"), local_whisper_available=False)
- assert plan.oww_keyword == "hey_rhasspy"
- assert plan.verify_prefix is False
+ assert plan.engine == "none"
+ assert plan.wake_available is False
# --------------------------------------------------------------------------
diff --git a/tests/unit/speech/test_wake_phrase.py b/tests/unit/speech/test_wake_phrase.py
index 9a33d1d4f9..738a6885a5 100644
--- a/tests/unit/speech/test_wake_phrase.py
+++ b/tests/unit/speech/test_wake_phrase.py
@@ -293,16 +293,31 @@ def test_arbitrary_phrase_with_local_whisper_resolves_to_stt_match() -> None:
assert plan.matcher.search("hey computer") is not None
-def test_arbitrary_phrase_without_local_whisper_degrades_to_rhasspy() -> None:
- # Path D now falls back to the bundled hey_rhasspy model (neutral default).
+def test_arbitrary_phrase_without_local_whisper_is_hotkey_only() -> None:
+ # Product rule (2026-07-04): no local model for the user's OWN word -> the
+ # wake word is OFF (hotkey / push-to-talk activation), NOT a silent branded
+ # 'Hey Rhasspy' fallback that listens for a word the user never says.
plan = resolve_wake_plan(_cfg(phrase="Computer"), local_whisper_available=False)
- assert plan.engine == "openwakeword"
- assert plan.oww_keyword == "hey_rhasspy"
+ assert plan.wake_available is False
+ assert plan.engine == "none"
+ assert plan.oww_model_path is None
assert plan.degraded is True
- assert plan.verify_prefix is False # rhasspy model IS the discriminator
assert "computer" in plan.message.lower()
- # The degraded message must point the user at the real options.
- assert "whisper" in plan.message.lower() or "onnx" in plan.message.lower()
+ # The message must point the user at the real options AND the hotkey.
+ assert "local" in plan.message.lower() or "onnx" in plan.message.lower()
+ assert "hotkey" in plan.message.lower() or "push-to-talk" in plan.message.lower()
+
+
+def test_wake_available_reflects_whether_a_local_model_exists() -> None:
+ # The product rule in one test: an arbitrary word works IF a local model is
+ # available (stt_match via local Whisper), and is hotkey-only otherwise —
+ # never a silent branded substitute.
+ with_model = resolve_wake_plan(_cfg(phrase="Nebula"), local_whisper_available=True)
+ assert with_model.engine == "stt_match"
+ assert with_model.wake_available is True
+ without = resolve_wake_plan(_cfg(phrase="Nebula"), local_whisper_available=False)
+ assert without.engine == "none"
+ assert without.wake_available is False
def test_explicit_custom_onnx_loads_user_model(tmp_path: object) -> None:
@@ -332,20 +347,20 @@ def test_custom_onnx_missing_file_degrades_to_stt_match_when_whisper_present(
assert plan.degraded is True
-def test_blank_phrase_degrades_to_rhasspy() -> None:
- # Blank phrase (shipped default / pre-onboarding) now degrades to hey_rhasspy.
+def test_blank_phrase_without_whisper_is_hotkey_only() -> None:
+ # Blank phrase (shipped default / pre-onboarding) + no local model -> wake OFF
+ # (hotkey-only), never a branded fallback.
plan = resolve_wake_plan(_cfg(phrase=" "), local_whisper_available=False)
- assert plan.oww_keyword == "hey_rhasspy"
- assert plan.engine == "openwakeword"
+ assert plan.wake_available is False
+ assert plan.engine == "none"
assert plan.degraded is True
- assert plan.verify_prefix is False
-def test_blank_phrase_without_whisper_degrades_to_rhasspy() -> None:
+def test_blank_cfg_without_whisper_is_hotkey_only() -> None:
plan = resolve_wake_plan(_cfg_blank(), local_whisper_available=False)
- assert plan.oww_keyword == "hey_rhasspy"
+ assert plan.wake_available is False
+ assert plan.engine == "none"
assert plan.degraded is True
- assert plan.verify_prefix is False
def test_jarvis_stays_typeable_resolves_to_hey_jarvis_model() -> None: