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-10 18:13)

Ruben Lütkeef6cddef05f1
diff --git a/jarvis/ui/web/frontend/src/views/ApiKeysView.section-health.test.tsx b/jarvis/ui/web/frontend/src/views/ApiKeysView.section-health.test.tsx
index 643d298c6f..60b50bae36 100644
--- a/jarvis/ui/web/frontend/src/views/ApiKeysView.section-health.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/ApiKeysView.section-health.test.tsx
@@ -61,11 +61,13 @@ function installFetchMock(routes: Record<string, () => RouteResult>) {
const SECTION_HEALTH = {
sections: {
- brain: { status: "needs_setup", reason: "not_configured", detail: "OpenRouter: no key set" },
- tts: { status: "ok", reason: "ok", detail: "Gemini Flash: ok" },
- stt: { status: "error", reason: "bad_key", detail: "Groq STT: key invalid" },
- subagents: { status: "unknown", reason: "unknown", detail: "" },
- advanced: { status: "unknown", reason: "unknown", detail: "" },
+ brain: { status: "needs_setup", reason: "not_configured", detail: "OpenRouter: no key set", subject_id: "openrouter" },
+ "computer-use": { status: "ok", reason: "ok", detail: "OpenRouter: ok", subject_id: "openrouter" },
+ tts: { status: "ok", reason: "ok", detail: "Gemini Flash: ok", subject_id: "gemini-flash-tts" },
+ stt: { status: "error", reason: "bad_key", detail: "Groq STT: key invalid", subject_id: "groq-api" },
+ realtime: { status: "unknown", reason: "unknown", detail: "", subject_id: null },
+ subagents: { status: "unknown", reason: "unknown", detail: "", subject_id: null },
+ advanced: { status: "unknown", reason: "unknown", detail: "", subject_id: null },
},
checked_at: 0,
cached: false,
@@ -74,7 +76,15 @@ const SECTION_HEALTH = {
function baseRoutes(overrides: Record<string, () => RouteResult> = {}) {
return {
"/api/providers/section-health": () => ({ body: SECTION_HEALTH }),
- "/api/providers": () => ({ body: { providers: [] } }),
+ "/api/providers/openrouter/models": () => ({
+ body: { provider: "openrouter", current_model: "", models: [], source: "static", fetched_at: 0, selects: "model" },
+ }),
+ "/api/providers/openrouter/cu-model": () => ({
+ body: { provider: "openrouter", cu_model: "", effective_model: "auto", uses_main: true },
+ }),
+ "/api/providers": () => ({
+ body: { providers: [BROKEN_BRAIN_PROVIDER, ACTIVE_TTS_PROVIDER, ACTIVE_STT_PROVIDER] },
+ }),
"/api/openclaw/status": () => ({ body: { mapping: [], brain_primary: "" } }),
...overrides,
};
@@ -108,13 +118,29 @@ const BROKEN_BRAIN_PROVIDER = {
alt_credential: null,
};
+const ACTIVE_TTS_PROVIDER = {
+ ...BROKEN_BRAIN_PROVIDER,
+ id: "gemini-flash-tts",
+ label: "Gemini Flash TTS",
+ tier: "tts",
+};
+
+const ACTIVE_STT_PROVIDER = {
+ ...BROKEN_BRAIN_PROVIDER,
+ id: "groq-api",
+ label: "Groq STT",
+ tier: "stt",
+};
+
const SECTION_HEALTH_BRAIN_ERROR = {
sections: {
- brain: { status: "error", reason: "rate_limited", detail: "OpenRouter: rate limited" },
- tts: { status: "ok", reason: "ok", detail: "Gemini Flash: ok" },
- stt: { status: "ok", reason: "ok", detail: "faster-whisper: local" },
- subagents: { status: "unknown", reason: "unknown", detail: "" },
- advanced: { status: "unknown", reason: "unknown", detail: "" },
+ brain: { status: "error", reason: "rate_limited", detail: "OpenRouter: rate limited", subject_id: "openrouter" },
+ "computer-use": { status: "ok", reason: "ok", detail: "OpenRouter: ok", subject_id: "openrouter" },
+ tts: { status: "ok", reason: "ok", detail: "Gemini Flash: ok", subject_id: "gemini-flash-tts" },
+ stt: { status: "ok", reason: "ok", detail: "faster-whisper: local", subject_id: "groq-api" },
+ realtime: { status: "unknown", reason: "unknown", detail: "", subject_id: null },
+ subagents: { status: "unknown", reason: "unknown", detail: "", subject_id: null },
+ advanced: { status: "unknown", reason: "unknown", detail: "", subject_id: null },
},
checked_at: 0,
cached: false,
@@ -122,9 +148,9 @@ const SECTION_HEALTH_BRAIN_ERROR = {
// Routes for a fully-rendered brain card: the active card mounts the model + CU
// pickers, which fetch their own catalogs on mount.
-function cardRoutes() {
+function cardRoutes(sectionHealth: unknown = SECTION_HEALTH_BRAIN_ERROR) {
return baseRoutes({
- "/api/providers/section-health": () => ({ body: SECTION_HEALTH_BRAIN_ERROR }),
+ "/api/providers/section-health": () => ({ body: sectionHealth }),
"/api/providers/openrouter/models": () => ({
body: { provider: "openrouter", current_model: "", models: [], source: "static", fetched_at: 0, selects: "model" },
}),
@@ -192,4 +218,26 @@ describe("ApiKeysView — section-health tab indicators", () => {
await waitFor(() => screen.getByRole("tab", { name: /Brain/i }));
expect(screen.queryByTestId("provider-health-error-openrouter")).toBeNull();
});
+
+ it("never attributes an obsolete NVIDIA timeout to active OpenRouter", async () => {
+ installFetchMock(
+ cardRoutes({
+ ...SECTION_HEALTH_BRAIN_ERROR,
+ sections: {
+ ...SECTION_HEALTH_BRAIN_ERROR.sections,
+ brain: {
+ status: "error",
+ reason: "timeout",
+ detail: "NVIDIA NIM: timeout after 60.0s",
+ subject_id: "nvidia",
+ },
+ },
+ }),
+ );
+ render(<ApiKeysView />);
+
+ const brainTab = await waitFor(() => screen.getByRole("tab", { name: /^Brain$/i }));
+ expect(brainTab.getAttribute("title")).toBeNull();
+ expect(screen.queryByTestId("provider-health-error-openrouter")).toBeNull();
+ });
});
diff --git a/tests/unit/plugins/wake/test_vosk_kws_provider.py b/tests/unit/plugins/wake/test_vosk_kws_provider.py
index 1455237a51..daace24c38 100644
--- a/tests/unit/plugins/wake/test_vosk_kws_provider.py
+++ b/tests/unit/plugins/wake/test_vosk_kws_provider.py
@@ -313,7 +313,14 @@ def test_verify_candidate_runs_grammar_and_free_decode_concurrently(monkeypatch)
p._ensure_model() # noqa: SLF001
window = np.full(48000, 0.2, dtype=np.float32)
- # Would raise threading.BrokenBarrierError (via the executor future) if
- # the two passes ran sequentially instead of concurrently.
result = p._verify_candidate(window) # noqa: SLF001
+ # A sequential regression breaks the barrier (only one party ever
+ # arrives at a time -> BrokenBarrierError after the 2 s timeout), which
+ # ``_verify_candidate``'s fail-open exception handler would otherwise
+ # silently turn into a passing ``True`` too — so the barrier's own
+ # broken-state is the real assertion, not just the return value.
+ assert barrier.broken is False, (
+ "the barrier never filled — grammar re-score and free decode ran "
+ "SEQUENTIALLY, not concurrently"
+ )
assert result is True
diff --git a/tests/unit/ui/jarvisbar/test_frame_pacing.py b/tests/unit/ui/jarvisbar/test_frame_pacing.py
index 2fbefb4816..145827cb55 100644
--- a/tests/unit/ui/jarvisbar/test_frame_pacing.py
+++ b/tests/unit/ui/jarvisbar/test_frame_pacing.py
@@ -18,6 +18,8 @@ real Tk display, so they run on every OS including a headless CI box.
"""
from __future__ import annotations
+import pytest
+
from jarvis.ui.jarvisbar.overlay import (
MIN_FRAME_DELAY_MS,
TARGET_FRAME_MS,
@@ -26,6 +28,18 @@ from jarvis.ui.jarvisbar.overlay import (
)
[email protected](autouse=True)
+def _no_real_tk_photoimage(monkeypatch):
+ """``_schedule_frame`` does a local ``from PIL import ImageTk`` and calls
+ ``ImageTk.PhotoImage(img)``, which needs a live Tk default root. These
+ tests run fully headless (fake root/canvas, no real Tk window), so
+ ``PhotoImage`` is replaced with a passthrough — the tests care about
+ render()/re-arm CALL COUNTS, not actual Tk image objects. Patching the
+ real ``PIL.ImageTk`` module attribute (not ``overlay``'s local name)
+ because the import is re-resolved fresh inside the function body."""
+ monkeypatch.setattr("PIL.ImageTk.PhotoImage", lambda img: img)
+
+
class _FakeRoot:
def __init__(self) -> None:
self.scheduled: list[tuple[int, object]] = []