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.

fix(providers): bind model health to exact selections

Ruben Lütke215d59a081ab
diff --git a/jarvis/ui/web/frontend/src/components/BrainModelSelector.test.tsx b/jarvis/ui/web/frontend/src/components/BrainModelSelector.test.tsx
index ea2bcb73c1..0ba52a1c0a 100644
--- a/jarvis/ui/web/frontend/src/components/BrainModelSelector.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/BrainModelSelector.test.tsx
@@ -257,6 +257,41 @@ describe("BrainModelSelector", () => {
});
});
+ it("hides obsolete health while probing and publishes the exact model result", async () => {
+ const pending = vi.fn();
+ const tested = vi.fn();
+ window.addEventListener("jarvis:provider-selection-pending", pending);
+ window.addEventListener("jarvis:provider-tested", tested);
+ vi.stubGlobal("fetch", mockFetch());
+ try {
+ render(
+ <BrainModelSelector
+ providerId="gemini"
+ currentModel=""
+ healthSection="brain"
+ healthActive
+ />,
+ );
+ await openDropdown();
+ fireEvent.click(await screen.findByText("gemini-3.1-pro-preview"));
+
+ await waitFor(() => expect(tested).toHaveBeenCalledTimes(1));
+ expect((pending.mock.calls[0][0] as CustomEvent).detail).toEqual({
+ section: "brain",
+ provider: "gemini",
+ });
+ expect((tested.mock.calls[0][0] as CustomEvent).detail).toMatchObject({
+ section: "brain",
+ provider: "gemini",
+ active: true,
+ result: { provider: "gemini", status: "ok" },
+ });
+ } finally {
+ window.removeEventListener("jarvis:provider-selection-pending", pending);
+ window.removeEventListener("jarvis:provider-tested", tested);
+ }
+ });
+
it("saves a custom model id that is not in the list", async () => {
const fetchMock = mockFetch();
vi.stubGlobal("fetch", fetchMock);
diff --git a/jarvis/ui/web/frontend/src/components/BrainModelSelector.tsx b/jarvis/ui/web/frontend/src/components/BrainModelSelector.tsx
index 6f97eb3783..f4bb9af714 100644
--- a/jarvis/ui/web/frontend/src/components/BrainModelSelector.tsx
+++ b/jarvis/ui/web/frontend/src/components/BrainModelSelector.tsx
@@ -128,7 +128,13 @@ export function BrainModelSelector({
onSave?: (model: string) => Promise<BrainModelSaveResult>;
/** Health section affected by this selection. When the provider is active,
* its obsolete result is hidden while the save/probe is in flight. */
- healthSection?: "brain" | "tts" | "stt" | "computer-use" | "subagents";
+ healthSection?:
+ | "brain"
+ | "tts"
+ | "stt"
+ | "realtime"
+ | "computer-use"
+ | "subagents";
/** Whether this picker belongs to the provider currently powering that section. */
healthActive?: boolean;
/**
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.section-health.test.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.section-health.test.tsx
index 24e45a5575..2e4ca2a889 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.section-health.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.section-health.test.tsx
@@ -23,6 +23,16 @@ vi.mock("@/hooks/useVoiceReadiness", () => ({
}),
}));
+vi.mock("@/hooks/useVoiceMode", () => ({
+ useVoiceMode: () => ({
+ mode: "pipeline",
+ realtimeAvailable: false,
+ setMode: vi.fn(),
+ isLoading: false,
+ isSaving: false,
+ }),
+}));
+
vi.mock("@/hooks/useProviders", async (importOriginal) => {
const actual = await importOriginal<typeof import("@/hooks/useProviders")>();
return {
diff --git a/jarvis/ui/web/provider_routes.py b/jarvis/ui/web/provider_routes.py
index 7ffb01930f..f0ec615d19 100644
--- a/jarvis/ui/web/provider_routes.py
+++ b/jarvis/ui/web/provider_routes.py
@@ -986,12 +986,16 @@ def _section_health_fingerprint(
tts = getattr(cfg, "tts", None) if cfg is not None else None
stt = getattr(cfg, "stt", None) if cfg is not None else None
worker = getattr(brain, "worker", None) if brain is not None else None
+ tts_extra = getattr(tts, "model_extra", None)
+ cartesia = tts_extra.get("cartesia") if isinstance(tts_extra, dict) else None
+ cartesia_model = cartesia.get("model_id") if isinstance(cartesia, dict) else None
configuration = (
("brain-model", _provider_value("brain", "model")),
("computer-use-model", _provider_value("computer-use", "cu_model")),
("tts-model", str(getattr(tts, "model", None) or "")),
("tts-voice-de", str(getattr(tts, "voice_de", None) or "")),
("tts-voice-en", str(getattr(tts, "voice_en", None) or "")),
+ ("tts-cartesia-model", str(cartesia_model or "")),
("stt-model", str(getattr(stt, "model", None) or "")),
("realtime-model", _provider_value("realtime", "model")),
("realtime-voice", _provider_value("realtime", "voice")),
diff --git a/tests/integration/test_provider_routes.py b/tests/integration/test_provider_routes.py
index 912b231090..021e8c78c4 100644
--- a/tests/integration/test_provider_routes.py
+++ b/tests/integration/test_provider_routes.py
@@ -18,7 +18,6 @@ from jarvis.core.config import JarvisConfig
from jarvis.core.events import SecretConfigured
from jarvis.ui.web.server import WebServer
-
# ----------------------------------------------------------------------
# Fakes
# ----------------------------------------------------------------------
diff --git a/tests/unit/brain/test_section_health.py b/tests/unit/brain/test_section_health.py
index 959c30bfde..803268311d 100644
--- a/tests/unit/brain/test_section_health.py
+++ b/tests/unit/brain/test_section_health.py
@@ -141,6 +141,9 @@ def test_health_fingerprint_covers_every_model_selection_surface() -> None:
assert pr._section_health_fingerprint(request, cfg, subjects) != baseline
setattr(owner, field, original)
+ cfg.tts.model_extra = {"cartesia": {"model_id": "sonic-new"}}
+ assert pr._section_health_fingerprint(request, cfg, subjects) != baseline
+
class TestSubagentSectionHealth:
"""Live-honest Sub-Agents tab health (2026-07-06 incident: the tab stayed