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
perf(boot): single-loader wake warm-up - stop the 114s model-load cascade
Ruben Lütke933ad0c75044
diff --git a/docs/diagnostics/BOOT-TTU-NOTES.md b/docs/diagnostics/BOOT-TTU-NOTES.mdindex c16707cc01..c7ef263410 100644--- a/docs/diagnostics/BOOT-TTU-NOTES.md+++ b/docs/diagnostics/BOOT-TTU-NOTES.md@@ -66,4 +66,22 @@ custom_onnx engine had hidden.## Fixes applied (append per loop iteration, with measured effect)-- (pending)+- **Fix for F1+F2 (iteration 2, commit pending):** single-loader wake warm-up.+ (a) `FasterWhisperProvider.is_warm` — True once `warm_up` completed (model+ constructed + primed); reset by `recover()`. (b) The rolling-whisper poll+ loop skips the transcribe phase (and self-heal fail counting) until+ `is_warm`; if nobody warms the model within `warm_wait_fallback_s` (20 s),+ the poll loop warms it once itself — exactly one loader either way.+ (c) `_wake_model_is_loaded` (heavy-backend gate) now prefers `is_warm`, so+ the backend CPU storm starts only after the priming inference.+ Expected effect: wake-model pre-warm back to ~4 s isolated (from 114.7 s),+ gate opens before its 12 s timeout, no self-heal rebuild during boot.+ MEASUREMENT PENDING (next boot).++## Lessons (do not repeat)++- The unit-test suite fast-forwards SMALL asyncio sleeps (a sleep accelerator;+ 600 poll iterations in 0.01 s real). Wall-clock-threshold logic cannot be+ tested with real waits — make thresholds injectable and use 0.0 in tests+ (see test_rolling_whisper_wake_boot_warm.py). Two hours of "phantom hangs"+ were exactly this.diff --git a/jarvis/speech/rolling_whisper_wake.py b/jarvis/speech/rolling_whisper_wake.pyindex 84e08fca81..9c2ba0594a 100644--- a/jarvis/speech/rolling_whisper_wake.py+++ b/jarvis/speech/rolling_whisper_wake.py@@ -36,7 +36,7 @@ import numpy as npfrom jarvis.audio.capture import pcm_bytes_to_npfrom jarvis.core.protocols import AudioChunk-from jarvis.plugins.stt.fwhisper import FasterWhisperProvider+from jarvis.plugins.stt.fwhisper import FasterWhisperProvider, TranscribeBusy# The strict "hey/hi/hallo + jarv-stem" pattern now lives in wake_constants as# the single source of truth (the prefix verifier re-exports the same object),@@ -79,6 +79,20 @@ _DEBUG_WAVS_ENV = os.environ.get("JARVIS_WAKE_DEBUG_WAVS", "").strip().lower() i# fire spuriously._WEDGE_RECOVER_AFTER_FAILS = 2+# Hard cap on a CONTINUOUS run of ``TranscribeBusy`` polls before the in-flight+# call is declared truly hung and the model is rebuilt. A busy poll right after+# an abandoned timeout is the SAME still-running call, not a second independent+# failure — the old accounting counted it toward ``_WEDGE_RECOVER_AFTER_FAILS``,+# so ONE transcription slower than the 8 s cap (routine under boot/CPU load,+# p95 was measured at 5.3 s under contention) tore down a healthy model, and+# the lazy cold rebuild inside the NEXT poll's 8 s timeout re-wedged — a+# self-perpetuating deaf cycle (live log 2026-07-02 08:21-08:26: three recover+# cycles in 2 minutes while the user was audibly speaking). 20 s tolerates any+# slow-but-alive call (which frees the lock and resets the streak on return)+# while a genuine BUG-036 hang (un-cancellable native call) is still recovered+# in bounded time (~8 s timeout + this cap).+_BUSY_HANG_RECOVER_S = 20.0+def _save_wav(pcm_bytes: bytes, sample_rate: int, path: Path) -> None:"""Writes int16 PCM as a valid WAV file."""@@ -209,10 +223,14 @@ class RollingWhisperWake:# -> reload from scratch under the boot CPU storm (114.7 s for a ~4 s# load). The poll phase therefore starts only on a warm model.warm_wait_fallback_s: float = 20.0,+ # How long a CONTINUOUS TranscribeBusy streak may run before the+ # in-flight call counts as truly hung (see _BUSY_HANG_RECOVER_S).+ busy_hang_recover_s: float = _BUSY_HANG_RECOVER_S,) -> None:self._stt = sttself._pattern = patternself._warm_wait_fallback_s = float(warm_wait_fallback_s)+ self._busy_hang_recover_s = float(busy_hang_recover_s)self._window_samples = int(window_s * sample_rate)self._poll_interval_s = poll_interval_sself._cooldown_s = cooldown_s