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.

refactor(wake): drop the user-facing sensitivity knob — pinned max-speed wake

Ruben Lütkef9f8c8ceb44f
diff --git a/tests/unit/core/test_wake_word_config.py b/tests/unit/core/test_wake_word_config.py
index b9cbe10ea3..92e8b49e85 100644
--- a/tests/unit/core/test_wake_word_config.py
+++ b/tests/unit/core/test_wake_word_config.py
@@ -1,8 +1,14 @@
"""WakeWordConfig — the user-editable [trigger.wake_word] schema.
Pins the custom-wake-word config contract: a ``phrase`` source of truth, an
-``engine`` validated against the SoT (boot-resilient coercion, AP-16), and
-sensitivity/fuzzy knobs. Legacy porcupine-era keys must still load.
+``engine`` validated against the SoT (boot-resilient coercion, AP-16), and a
+fuzzy-match knob. Legacy porcupine-era keys must still load.
+
+``sensitivity`` is READ-COMPAT ONLY since 2026-07-10 (the user-facing
+Sensitivity slider was removed — every wake path now always runs at its
+calibrated-reliable maximum-speed value). The field stays on the model so an
+existing jarvis.toml with a hand-set value still parses and boots; it is no
+longer read by ``resolve_wake_plan``.
"""
from __future__ import annotations
@@ -71,3 +77,18 @@ def test_sensitivity_valid_range_round_trips() -> None:
assert WakeWordConfig(sensitivity=0.75).sensitivity == 0.75
assert WakeWordConfig(sensitivity=1.0).sensitivity == 1.0
assert WakeWordConfig(sensitivity=2.0).sensitivity == 1.0 # ceiling clamp
+
+
+def test_sensitivity_parses_but_no_longer_drives_the_resolved_wake_plan() -> None:
+ # Guard for the 2026-07-10 removal: a legacy sensitivity value still loads
+ # cleanly on the config model (back-compat), but resolve_wake_plan() no
+ # longer varies its threshold with it — every path runs its pinned,
+ # calibrated-reliable value regardless.
+ from jarvis.plugins.wake.openwakeword_provider import PRODUCTION_WAKE_THRESHOLD
+ from jarvis.speech.wake_phrase import resolve_wake_plan
+
+ low = WakeWordConfig(phrase="Computer", sensitivity=0.5)
+ high = WakeWordConfig(phrase="Computer", sensitivity=1.0)
+ plan_low = resolve_wake_plan(low, local_whisper_available=True)
+ plan_high = resolve_wake_plan(high, local_whisper_available=True)
+ assert plan_low.threshold == plan_high.threshold == PRODUCTION_WAKE_THRESHOLD
diff --git a/tests/unit/speech/test_pipeline_wake_plan.py b/tests/unit/speech/test_pipeline_wake_plan.py
index fe658aeffe..02f1c416d9 100644
--- a/tests/unit/speech/test_pipeline_wake_plan.py
+++ b/tests/unit/speech/test_pipeline_wake_plan.py
@@ -1,7 +1,7 @@
"""SpeechPipeline honours a resolved WakeWordPlan.
When a wake_plan is threaded in, the OpenWakeWord detector is built from the
-plan (model path, canonical keyword, sensitivity-derived threshold) and the
+plan (model path, canonical keyword, calibrated activation threshold) and the
prefix verifier + rolling-whisper use the plan's phrase matcher. When no plan
is given, the legacy default path builds a provider with no model.
"""
diff --git a/tests/unit/speech/test_wake_custom_model.py b/tests/unit/speech/test_wake_custom_model.py
index 0b8a55e30c..7b1060458e 100644
--- a/tests/unit/speech/test_wake_custom_model.py
+++ b/tests/unit/speech/test_wake_custom_model.py
@@ -48,13 +48,19 @@ def test_custom_onnx_uses_calibrated_higher_threshold(tmp_path) -> None:
model.write_bytes(b"onnx") # resolve only checks the path is a file
plan = resolve_wake_plan(_cfg(str(model)), local_whisper_available=False)
assert plan.engine == "custom_onnx"
- # A calibrated custom model uses a HIGH threshold (~0.5 at mid sensitivity),
- # NOT the 0.15 pretrained band that false-fires on breath/other words.
+ # A calibrated custom model uses a HIGH threshold (the balanced default,
+ # 0.50), NOT the 0.15 pretrained band that false-fires on breath/other
+ # words.
assert plan.threshold >= 0.45, plan.threshold
-def test_custom_onnx_threshold_scales_strict_to_sensitive(tmp_path) -> None:
- from jarvis.speech.wake_phrase import resolve_wake_plan
+def test_custom_onnx_threshold_is_pinned_regardless_of_legacy_sensitivity(
+ tmp_path,
+) -> None:
+ """Guard: the Sensitivity slider was removed 2026-07-10 — the custom_onnx
+ threshold is now the fixed CUSTOM_ONNX_THRESHOLD, no matter what a legacy
+ config carries in ``sensitivity`` (read-compat-only field)."""
+ from jarvis.speech.wake_phrase import CUSTOM_ONNX_THRESHOLD, resolve_wake_plan
model = tmp_path / "m.onnx"
model.write_bytes(b"onnx")
@@ -62,10 +68,8 @@ def test_custom_onnx_threshold_scales_strict_to_sensitive(tmp_path) -> None:
def thr(s: float) -> float:
return resolve_wake_plan(_cfg(str(model), s), local_whisper_available=False).threshold
- strict, sensitive = thr(0.0), thr(1.0)
- assert strict > sensitive, (strict, sensitive) # 0.0 = least likely to fire
- assert 0.60 <= strict <= 0.75
- assert 0.25 <= sensitive <= 0.35
+ for s in (0.0, 0.3, 0.5, 0.7, 1.0):
+ assert thr(s) == pytest.approx(CUSTOM_ONNX_THRESHOLD), s
# ---------------------------------------------------------------------------
diff --git a/tests/unit/ui/test_wake_word_route.py b/tests/unit/ui/test_wake_word_route.py
index f8b72e1eb6..b54cf80e94 100644
--- a/tests/unit/ui/test_wake_word_route.py
+++ b/tests/unit/ui/test_wake_word_route.py
@@ -41,6 +41,9 @@ def test_get_returns_current_and_options() -> None:
assert "auto" in body["engines"] and "stt_match" in body["engines"]
assert "Hey Jarvis" not in body["instant_phrases"] # instant quick-picks are empty
assert isinstance(body["local_whisper_available"], bool)
+ # The Sensitivity slider was removed 2026-07-10 — the GET payload no
+ # longer surfaces a sensitivity value.
+ assert "sensitivity" not in body
def test_put_brand_phrase_never_resolves_to_a_pretrained_model() -> None:
@@ -113,22 +116,22 @@ def test_omitted_tuning_fields_default_to_none() -> None:
def test_put_omits_tuning_fields_so_persist_does_not_clobber(monkeypatch) -> None:
- # When the client omits fuzzy_match_ratio/sensitivity, the persist call must
- # receive None for them (set_wake_word then skips writing → preserves the
- # existing toml value). This is the exact bug the reviewer caught.
+ # When the client omits fuzzy_match_ratio, the persist call must receive
+ # None for it (set_wake_word then skips writing → preserves the existing
+ # toml value). This is the exact bug the reviewer caught. sensitivity is
+ # no longer part of the set_wake_word signature at all (removed 2026-07-10).
from jarvis.core import config_writer
captured: dict = {}
def _fake_set_wake_word(
phrase, *, engine=None, custom_model_path=None,
- sensitivity=None, fuzzy_match_ratio=None, path=None,
+ fuzzy_match_ratio=None, path=None,
):
captured.update(
phrase=phrase,
engine=engine,
custom_model_path=custom_model_path,
- sensitivity=sensitivity,
fuzzy_match_ratio=fuzzy_match_ratio,
)
@@ -142,4 +145,21 @@ def test_put_omits_tuning_fields_so_persist_does_not_clobber(monkeypatch) -> Non
assert resp.json()["persisted"] is True
assert captured["phrase"] == "Computer"
assert captured["fuzzy_match_ratio"] is None # NOT 0.5 — would clobber 0.8
- assert captured["sensitivity"] is None
+ assert "sensitivity" not in captured
+
+
+def test_put_with_legacy_sensitivity_is_accepted_but_ignored() -> None:
+ # Back-compat guard (2026-07-10): an old client/CLI body carrying
+ # 'sensitivity' must not 422, and the value must not surface anywhere in
+ # the response — it is simply dropped.
+ resp = _client().put(
+ "/api/settings/wake-word",
+ json={
+ "phrase": "Computer",
+ "engine": "auto",
+ "sensitivity": 0.9,
+ "persist": False,
+ },
+ )
+ assert resp.status_code == 200
+ assert "sensitivity" not in resp.json()