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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
chore: auto-save WIP via Claude stop-hook safety net (2026-07-10 19:09)
Ruben Lütkee4758e51c4e0
diff --git a/jarvis/core/config.py b/jarvis/core/config.pyindex 0a82eabd98..2004a72590 100644--- a/jarvis/core/config.py+++ b/jarvis/core/config.py@@ -194,16 +194,13 @@ class WakeWordConfig(BaseModel):engine: str = "auto"# Path to a user-supplied/trained .onnx wake model (engine="custom_onnx").custom_model_path: str = ""- # 0.5..1 wake responsiveness. openWakeWord path: mapped onto the activation- # threshold (0.5 == the data-driven PRODUCTION_WAKE_THRESHOLD, BUG-009 floor- # preserved). stt_match (local-Whisper) path: drives the poll interval- # (higher => polls more often => a spoken wake is picked up sooner), since- # that path never scores against the threshold.- # FLOOR 0.5 (user mandate 2026-07-07): below the calibrated midpoint the- # detector becomes so strict that normal-volume speech practically never- # fires it — a live config at 0.0 read as "the wake word is broken", not- # as "less sensitive". Values below the floor are LIFTED to 0.5 on load so- # an old/hand-edited jarvis.toml can never boot into a deaf wake word.+ # READ-COMPAT ONLY, runtime-ignored since 2026-07-10: the user-facing+ # Sensitivity slider was removed (mandate: always run every wake path at+ # its calibrated-reliable maximum-speed value, identically on every OS —+ # no per-user tuning). ``resolve_wake_plan`` no longer reads this field.+ # Kept so an existing jarvis.toml with a hand-set ``sensitivity`` still+ # parses and boots cleanly (open-source §3 / AP-16 back-compat); the+ # floor validator stays only to keep any stored value well-formed.sensitivity: float = 0.5# STT transcript-match tolerance for transcription drift (engine="stt_match").fuzzy_match_ratio: float = 0.8diff --git a/jarvis/core/config_writer.py b/jarvis/core/config_writer.pyindex e47437748c..4e191550cd 100644--- a/jarvis/core/config_writer.py+++ b/jarvis/core/config_writer.py@@ -468,7 +468,6 @@ def set_wake_word(*,engine: str | None = None,custom_model_path: str | None = None,- sensitivity: float | None = None,fuzzy_match_ratio: float | None = None,path: Path = DEFAULT_CONFIG_FILE,) -> None:@@ -498,8 +497,6 @@ def set_wake_word(values["engine"] = engineif custom_model_path is not None:values["custom_model_path"] = custom_model_path- if sensitivity is not None:- values["sensitivity"] = float(sensitivity)if fuzzy_match_ratio is not None:values["fuzzy_match_ratio"] = float(fuzzy_match_ratio)_patch_wake_word_toml(path, values)diff --git a/jarvis/speech/pipeline.py b/jarvis/speech/pipeline.pyindex 33452669d3..b587d91ab6 100644--- a/jarvis/speech/pipeline.py+++ b/jarvis/speech/pipeline.py@@ -1736,20 +1736,13 @@ class SpeechPipeline:reload_event.set()def _wake_poll_interval(self) -> float:- """The stt_match wake poll interval, derived from the user's Sensitivity- slider (``[trigger.wake_word].sensitivity``). Higher sensitivity polls- more often, so a spoken wake is picked up sooner. Defensive: any missing- field falls back to the balanced default. This is what makes the slider- actually DO something on the local-Whisper transcript path (it never- scored against the openWakeWord threshold the slider used to feed)."""- from jarvis.speech.wake_phrase import sensitivity_to_poll_interval-- ww = getattr(getattr(self, "_config", None), "trigger", None)- ww = getattr(ww, "wake_word", None)- try:- return sensitivity_to_poll_interval(getattr(ww, "sensitivity", 0.5))- except (TypeError, ValueError):- return sensitivity_to_poll_interval(0.5)+ """The stt_match wake poll interval — always the fastest calibrated+ value (the user-facing Sensitivity slider was removed 2026-07-10;+ "always spawn at maximum speed on every OS" is now unconditional, not+ a slider-derived choice)."""+ from jarvis.speech.wake_phrase import WAKE_POLL_INTERVAL_S++ return WAKE_POLL_INTERVAL_Sdef set_wake_plan(self, plan: Any) -> None:"""Live-apply a resolved WakeWordPlan — no app/pipeline restart.diff --git a/jarvis/speech/wake_phrase.py b/jarvis/speech/wake_phrase.pyindex 142fb65d4c..42cb1f37c4 100644--- a/jarvis/speech/wake_phrase.py+++ b/jarvis/speech/wake_phrase.py@@ -41,51 +41,29 @@ from jarvis.speech.wake_constants import (log = logging.getLogger("jarvis.wake.phrase")-# Lower threshold floor (most sensitive) and upper ceiling (least sensitive)-# for the sensitivity->threshold mapping. The midpoint (sensitivity 0.5) is-# pinned to the data-driven PRODUCTION_WAKE_THRESHOLD so the default is-# unchanged and the BUG-009 floor reasoning still holds at the default.-_THRESHOLD_CEILING = 0.30 # sensitivity 0.0-_THRESHOLD_FLOOR = 0.06 # sensitivity 1.0---def sensitivity_to_threshold(sensitivity: float) -> float:- """Map a 0..1 sensitivity onto an openWakeWord activation threshold.-- Anchored piecewise-linear: 0.0 -> 0.30, 0.5 -> PRODUCTION_WAKE_THRESHOLD,- 1.0 -> 0.06. Higher sensitivity => lower threshold => easier to trigger.- """- s = max(0.0, min(1.0, float(sensitivity)))- if s <= 0.5:- span = PRODUCTION_WAKE_THRESHOLD - _THRESHOLD_CEILING- return _THRESHOLD_CEILING + span * (s / 0.5)- span = _THRESHOLD_FLOOR - PRODUCTION_WAKE_THRESHOLD- return PRODUCTION_WAKE_THRESHOLD + span * ((s - 0.5) / 0.5)---# stt_match responsiveness: the openWakeWord threshold above is meaningless for-# the local-Whisper transcript path (it does not score against a threshold), so-# a custom-phrase user moving the Sensitivity slider felt NOTHING. Map the same-# 0..1 slider onto how OFTEN that path re-transcribes the rolling window: a-# higher sensitivity polls more often, so a spoken wake is picked up sooner.-# Both ends are deliberately FAST — the user's mandate is "always as low as-# possible" (2026-07-02). The slider still trims a little, but even its lowest-# position must not feel slow, so the slow end is 0.12 s, not a lazy 0.20 s.-_POLL_INTERVAL_SLOW = 0.12 # sensitivity 0.0 — still snappy-_POLL_INTERVAL_FAST = 0.08 # sensitivity 1.0 — snappiest reaction---def sensitivity_to_poll_interval(sensitivity: float) -> float:- """Map a 0..1 sensitivity onto the stt_match wake poll interval (seconds).-- Linear: 0.0 -> 0.12 s, 1.0 -> 0.08 s. Both ends are fast on purpose (the- "always as low as possible" mandate); higher sensitivity just trims a little- more. The dominant latency floor is the ~0.5 s transcription itself, so the- poll interval is a minor knob — the real win is skipping the second- confirming transcription on a clearly-loud wake (unconditional).- """- s = max(0.0, min(1.0, float(sensitivity)))- return _POLL_INTERVAL_SLOW + (_POLL_INTERVAL_FAST - _POLL_INTERVAL_SLOW) * s+# The user-facing Sensitivity slider was removed (2026-07-10 mandate: "remove+# the control; always spawn at maximum speed on every OS" — identically on+# Windows/macOS/Linux, no per-user tuning). Every wake path now runs its+# calibrated-reliable value unconditionally instead of a slider-derived one:+#+# - stt_match poll interval: pinned to the fast end that used to be+# sensitivity=1.0 — the "always as fast as possible" (2026-07-02) mandate+# made the slow end a formality anyway.+WAKE_POLL_INTERVAL_S = 0.08++# - openWakeWord pretrained-model threshold: pinned to the data-driven+# PRODUCTION_WAKE_THRESHOLD (imported above) directly, not the old+# slider-scaled midpoint. This is a recall/false-positive tradeoff, not a+# speed knob — the calibrated production value IS the fastest *reliable*+# trigger; pinning to the old sensitive extreme (0.06) would re-open the+# ghost-wake war (BUG-009/BUG-037/AP-27 history).++# - custom_onnx model threshold: pinned to the "balanced default" of the+# calibrated 0.70 (strict) / 0.50 (balanced) / 0.30 (sensitive) band. A+# TRAINED custom_onnx model outputs well-calibrated 0..1 scores; the+# sensitive extreme false-fires on breathing and random words (live+# 2026-07-01 forensic — see resolve_wake_plan below).+CUSTOM_ONNX_THRESHOLD = 0.50class _FuzzyMatch:@@ -327,7 +305,10 @@ def resolve_wake_plan("""Resolve a ``[trigger.wake_word]`` config into a :class:`WakeWordPlan`.``cfg`` is duck-typed: any object exposing ``phrase``, ``engine``,- ``custom_model_path``, ``sensitivity``, ``fuzzy_match_ratio``.+ ``custom_model_path``, ``fuzzy_match_ratio``. ``sensitivity`` is no longer+ read (the user-facing slider was removed 2026-07-10 — every wake path now+ runs its calibrated-reliable value unconditionally; a legacy config may+ still carry the field, it is simply ignored here).``language`` selects the per-language Vosk model for the ``vosk_kws``engine (falls back to the first installed model on ``auto``/None).@@ -340,17 +321,10 @@ def resolve_wake_plan(log.warning("Unknown wake engine %r — coercing to 'auto'.", engine_pref)engine_pref = "auto"custom_path = str(_read(cfg, "custom_model_path", "")).strip()- sensitivity = float(_read(cfg, "sensitivity", 0.5))fuzzy = float(_read(cfg, "fuzzy_match_ratio", 0.8))- threshold = sensitivity_to_threshold(sensitivity)- # A TRAINED custom_onnx model outputs well-calibrated 0..1 scores — a genuine- # wake lands ~0.85-0.95 and breath/ambient/other-words well below — NOT the- # 0.15-0.23 band the pretrained-openWakeWord 0.06-0.30 sensitivity map was- # tuned for. Using that low band for a custom model false-fires on breathing- # and random words (live 2026-07-01). So a custom model uses a higher band:- # 0.0 -> 0.70 (strict), 0.5 -> 0.50 (balanced default), 1.0 -> 0.30 (sensitive).- custom_threshold = 0.70 - 0.40 * max(0.0, min(1.0, sensitivity))+ threshold = PRODUCTION_WAKE_THRESHOLD+ custom_threshold = CUSTOM_ONNX_THRESHOLDmatcher = compile_wake_matcher(phrase, fuzzy_ratio=fuzzy)canonical = _canonical_keyword(phrase)@@ -563,11 +537,11 @@ def resolve_wake_plan(__all__ = [+ "CUSTOM_ONNX_THRESHOLD",+ "WAKE_POLL_INTERVAL_S","WakeMatcher","WakeWordPlan","compile_wake_matcher","custom_model_matches_phrase","resolve_wake_plan",- "sensitivity_to_poll_interval",- "sensitivity_to_threshold",]diff --git a/jarvis/ui/web/frontend/src/hooks/useWakeWord.ts b/jarvis/ui/web/frontend/src/hooks/useWakeWord.tsindex 346b03347a..0368a54ced 100644--- a/jarvis/ui/web/frontend/src/hooks/useWakeWord.ts+++ b/jarvis/ui/web/frontend/src/hooks/useWakeWord.ts@@ -8,7 +8,6 @@ export interface WakeWordConfig {phrase: string;engine: string;custom_model_path: string;- sensitivity: number;fuzzy_match_ratio: number;engines: string[];instant_phrases: string[];@@ -26,7 +25,6 @@ export interface WakeWordPayload {phrase: string;engine: string;custom_model_path?: string;- sensitivity?: number;fuzzy_match_ratio?: number;persist?: boolean;}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 1b300887ad..0e58f9b02e 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -1091,8 +1091,6 @@"self_test_button": "Wake-Word testen","self_test_running": "Prüfe …","engine_label": "Erkennungs-Engine",- "sensitivity_label": "Empfindlichkeit",- "sensitivity_floor_note": "Minimum ist 0,5: Darunter wird die Erkennung so streng, dass normale Sprechlautstärke praktisch nie auslöst — das wirkt kaputt statt \"weniger empfindlich\". 0,5 ist der ausbalancierte Standard; höhere Werte lösen leichter aus.","custom_model_path_label": "Pfad zum eigenen ONNX-Modell","save": "Wake-Word speichern","saved": "Wake-Word gespeichert",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 9cfdeef03e..ba3d2cc4ab 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -1092,8 +1092,6 @@"self_test_button": "Test wake word","self_test_running": "Checking…","engine_label": "Detection engine",- "sensitivity_label": "Sensitivity",- "sensitivity_floor_note": "Minimum is 0.5: below the calibrated midpoint the detector becomes so strict that normal speech practically never wakes it — that feels broken, not \"less sensitive\". 0.5 is the balanced default; higher values trigger more easily.","custom_model_path_label": "Custom ONNX model path","save": "Save wake word","saved": "Wake word saved",diff --git a/jarvis/ui/web/frontend/src/views/SettingsView.tsx b/jarvis/ui/web/frontend/src/views/SettingsView.tsxindex 942df38ef4..e5e092c2d1 100644--- a/jarvis/ui/web/frontend/src/views/SettingsView.tsx+++ b/jarvis/ui/web/frontend/src/views/SettingsView.tsx@@ -137,10 +137,13 @@ function SettingRow({ row }: { row: SettingRow }) {}/**- * Editable wake-word panel: free-text phrase input, engine select, sensitivity- * slider, optional custom-model path, and a Save button that surfaces the- * backend's resolved engine, message, and a restart hint. A degraded result is- * shown as a warning; a phrase without local-Whisper gets an inline hint.+ * Editable wake-word panel: free-text phrase input, engine select, optional+ * custom-model path, and a Save button that surfaces the backend's resolved+ * engine, message, and a restart hint. A degraded result is shown as a+ * warning; a phrase without local-Whisper gets an inline hint. There is no+ * user-facing speed/sensitivity control (removed 2026-07-10 mandate): every+ * wake path always runs at its calibrated-reliable maximum-speed value,+ * identically on every OS.** No quick-pick chips: the user must type their own phrase. The onboarding gate* (WakeWordOnboardingGate) handles the mandatory first-run flow.@@ -257,7 +260,6 @@ function WakeWordPanel() {const sttLang = useSttLanguage();const [phrase, setPhrase] = useState("");const [engine, setEngine] = useState<string>("auto");- const [sensitivity, setSensitivity] = useState(0.5);const [customModelPath, setCustomModelPath] = useState("");const [saving, setSaving] = useState(false);const [result, setResult] = useState<WakeWordSaveResult | null>(null);@@ -283,9 +285,6 @@ function WakeWordPanel() {if (!config) return;setPhrase(config.phrase);setEngine(config.engine || "auto");- // Floor 0.5 (matches the backend clamp): an old config below the floor is- // shown lifted, never as a deaf sub-floor value.- setSensitivity(Math.max(0.5, config.sensitivity));setCustomModelPath(config.custom_model_path ?? "");// ?? false keeps the Switch controlled even if an older backend omits it.setEnabled(config.enabled ?? false);@@ -328,7 +327,6 @@ function WakeWordPanel() {const res = await saveWakeWord({phrase: trimmedPhrase,engine,- sensitivity,custom_model_path:engine === "custom_onnx" ? customModelPath.trim() : undefined,persist: true,@@ -536,29 +534,6 @@ function WakeWordPanel() {</>)}- {/* Sensitivity slider */}- <label className="mt-4 flex items-center justify-between text-xs font-medium text-muted-foreground">- <span>{t("settings_view.wake_word.sensitivity_label")}</span>- <span className="font-mono text-primary">- {sensitivity.toFixed(2)}- </span>- </label>- <input- type="range"- min={0.5}- max={1}- step={0.05}- value={sensitivity}- onChange={(e) => setSensitivity(Number(e.target.value))}- disabled={loading}- className="mt-1.5 w-full accent-primary disabled:opacity-50"- />- {/* Fine print: why the slider bottoms out at 0.5 (user mandate- 2026-07-07 — a sub-floor sensitivity reads as a broken wake). */}- <p className="mt-1 text-[11px] leading-snug text-muted-foreground">- {t("settings_view.wake_word.sensitivity_floor_note")}- </p>-{/* Any-phrase enablement: install the local speech pack in-app soan arbitrary wake word works, instead of silently degrading. */}{showNeedsWhisperHint && (diff --git a/jarvis/ui/web/settings_routes.py b/jarvis/ui/web/settings_routes.pyindex 3774bbfc0e..7cf99b4126 100644--- a/jarvis/ui/web/settings_routes.py+++ b/jarvis/ui/web/settings_routes.py@@ -7,7 +7,7 @@ Endpoints:GET /api/settings/reply-language → {"language": ..., "options": [...]}PUT /api/settings/reply-language → switch the live BrainManager + persistGET /api/settings/wake-word → {phrase, engine, custom_model_path,- sensitivity, fuzzy_match_ratio, engines,+ fuzzy_match_ratio, engines,instant_phrases, local_whisper_available}PUT /api/settings/wake-word → persist to jarvis.toml [trigger.wake_word](+ resolved-plan preview); restart required@@ -472,6 +472,12 @@ class WakeWordBody(BaseModel):phrase: str = Field(..., min_length=1, max_length=64)engine: str = Field(default="auto")custom_model_path: str | None = Field(default=None)+ # READ-COMPAT ONLY, runtime-ignored since 2026-07-10: the user-facing+ # Sensitivity slider was removed (every wake path now always runs at its+ # calibrated-reliable maximum-speed value, identically on every OS). The+ # field stays accepted so an old client / CLI body with a stray+ # ``sensitivity`` value does not 422 — it is simply dropped, never+ # persisted, never floored.sensitivity: float | None = Field(default=None, ge=0.0, le=1.0)fuzzy_match_ratio: float | None = Field(default=None, ge=0.5, le=1.0)persist: bool = Field(default=True, description="Persist to jarvis.toml")@@ -587,7 +593,6 @@ async def get_wake_word(request: Request) -> dict[str, object]:"phrase": ww.phrase,"engine": ww.engine,"custom_model_path": ww.custom_model_path,- "sensitivity": ww.sensitivity,"fuzzy_match_ratio": ww.fuzzy_match_ratio,"engines": list(WAKE_ENGINES),"instant_phrases": list(INSTANT_WAKE_PHRASES),@@ -612,12 +617,14 @@ async def put_wake_word(body: WakeWordBody, request: Request) -> dict[str, objecdetail=f"Unknown wake engine '{body.engine}'. Allowed: {', '.join(WAKE_ENGINES)}.",)- # Sensitivity floor 0.5 (user mandate 2026-07-07): below the calibrated- # midpoint the wake word is effectively deaf. Lift instead of reject —- # mirrors WakeWordConfig._floor_sensitivity so every write path agrees.- sensitivity = (- None if body.sensitivity is None else min(1.0, max(0.5, body.sensitivity))- )+ # Sensitivity is read-compat only (2026-07-10): accept it so an old+ # client/CLI body does not 422, but never persist or floor it — every+ # wake path always runs at its calibrated-reliable maximum-speed value.+ if body.sensitivity is not None:+ log.debug(+ "wake-word PUT carried a legacy 'sensitivity' value (%s) — ignored.",+ body.sensitivity,+ )# Preview the resolved plan so the UI can tell the user immediately whether# the chosen phrase will work as-is or degrade (e.g. no local Whisper).@@ -634,7 +641,6 @@ async def put_wake_word(body: WakeWordBody, request: Request) -> dict[str, objecphrase=body.phrase,engine=engine,custom_model_path=body.custom_model_path,- sensitivity=sensitivity,fuzzy_match_ratio=body.fuzzy_match_ratio,),local_whisper_available=_local_whisper_available(),@@ -650,8 +656,6 @@ async def put_wake_word(body: WakeWordBody, request: Request) -> dict[str, objecupdates: dict[str, object] = {"phrase": body.phrase, "engine": engine}if body.custom_model_path is not None:updates["custom_model_path"] = body.custom_model_path- if sensitivity is not None:- updates["sensitivity"] = sensitivityif body.fuzzy_match_ratio is not None:updates["fuzzy_match_ratio"] = body.fuzzy_match_ratiofor key, value in updates.items():@@ -669,7 +673,6 @@ async def put_wake_word(body: WakeWordBody, request: Request) -> dict[str, objecbody.phrase,engine=engine,custom_model_path=body.custom_model_path,- sensitivity=sensitivity,fuzzy_match_ratio=body.fuzzy_match_ratio,)persisted = Truediff --git a/tests/unit/core/test_config_writer_wake_word.py b/tests/unit/core/test_config_writer_wake_word.pyindex de5b286d69..2560ff31c4 100644--- a/tests/unit/core/test_config_writer_wake_word.py+++ b/tests/unit/core/test_config_writer_wake_word.py@@ -67,7 +67,6 @@ def test_set_wake_word_updates_all_provided_fields(tmp_path: Path) -> None:"Friday",engine="custom_onnx",custom_model_path="/models/friday.onnx",- sensitivity=0.7,fuzzy_match_ratio=0.85,path=f,)@@ -75,10 +74,26 @@ def test_set_wake_word_updates_all_provided_fields(tmp_path: Path) -> None:assert ww["phrase"] == "Friday"assert ww["engine"] == "custom_onnx"assert ww["custom_model_path"] == "/models/friday.onnx"- assert ww["sensitivity"] == 0.7assert ww["fuzzy_match_ratio"] == 0.85+def test_set_wake_word_no_longer_accepts_sensitivity_kwarg(tmp_path: Path) -> None:+ # Guard: the Sensitivity slider was removed 2026-07-10 — set_wake_word() has+ # no sensitivity parameter any more (a legacy jarvis.toml value is left+ # untouched by set_wake_word since it is simply never in the update set).+ import inspect++ assert "sensitivity" not in inspect.signature(config_writer.set_wake_word).parameters+++def test_set_wake_word_leaves_a_legacy_sensitivity_value_untouched(tmp_path: Path) -> None:+ f = _write(tmp_path) # fixture carries a legacy sensitivity = 0.5+ config_writer.set_wake_word("Computer", engine="stt_match", path=f)+ ww = _load(f)["trigger"]["wake_word"]+ assert ww["phrase"] == "Computer"+ assert ww["sensitivity"] == 0.5 # untouched legacy value, still present++def test_set_wake_word_is_bom_safe(tmp_path: Path) -> None:f = _write(tmp_path, bom=True)config_writer.set_wake_word("Computer", path=f)