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
fix(ui): health dots re-read on pushed outcome changes; ready note claims setup only
rubenluetke10-beep5c12497898cb
diff --git a/jarvis/ui/web/frontend/src/components/ReadyCelebration.tsx b/jarvis/ui/web/frontend/src/components/ReadyCelebration.tsxindex 63d47783a3..dc7e30d344 100644--- a/jarvis/ui/web/frontend/src/components/ReadyCelebration.tsx+++ b/jarvis/ui/web/frontend/src/components/ReadyCelebration.tsx@@ -6,7 +6,9 @@ import { useT } from "@/i18n";import { cn } from "@/lib/utils";/**- * The one-time "all lights green" note.+ * The one-time "all set" note. It says the sections are set up — never that+ * the providers answered: readiness counts a keyed provider that has not made+ * a real call yet, because nothing probes it (that would bill the key).** Shown exactly once: the first time every section the active voice mode* needs is set up with no known failure in the section-health rollup@@ -27,6 +29,9 @@ const REFRESH_EVENTS = ["jarvis:agent-switched","jarvis:provider-tested","jarvis:provider-config-changed",+ // A real call changed a provider's recorded health (server push over the+ // existing WebSocket); readiness is re-read with a plain GET.+ "jarvis:provider-health-changed",];export function ReadyCelebration({ inline = false }: { inline?: boolean }) {diff --git a/jarvis/ui/web/frontend/src/components/agentchat/AgentComposer.tsx b/jarvis/ui/web/frontend/src/components/agentchat/AgentComposer.tsxindex ddaf7005a4..de542b6d44 100644--- a/jarvis/ui/web/frontend/src/components/agentchat/AgentComposer.tsx+++ b/jarvis/ui/web/frontend/src/components/agentchat/AgentComposer.tsx@@ -129,11 +129,30 @@ export function AgentComposer({ autoFocus = false }: { autoFocus?: boolean }) {const send = useAgentChat((s) => s.send);const cancel = useAgentChat((s) => s.cancel);const loadCatalog = useAgentChat((s) => s.loadCatalog);+ const loadHealth = useAgentChat((s) => s.loadHealth);useEffect(() => {if (!catalog) void loadCatalog();}, [catalog, loadCatalog]);+ // A real call changed a seat's recorded health, or a key was saved or+ // removed somewhere: re-read the dots (a plain read — the server never+ // probes a provider for them). Debounced, since one turn can report+ // several providers.+ useEffect(() => {+ let timer: number | undefined;+ const reread = () => {+ window.clearTimeout(timer);+ timer = window.setTimeout(() => void loadHealth(), 400);+ };+ const events = ["jarvis:provider-health-changed", "jarvis:secret-configured"];+ events.forEach((e) => window.addEventListener(e, reread));+ return () => {+ window.clearTimeout(timer);+ events.forEach((e) => window.removeEventListener(e, reread));+ };+ }, [loadHealth]);+const providers = useMemo<ProviderOption[]>(() => store.getState().providerOptions(),// Recompute when either half of the join changes.diff --git a/jarvis/ui/web/frontend/src/components/agentchat/providerHealth.test.tsx b/jarvis/ui/web/frontend/src/components/agentchat/providerHealth.test.tsxindex cce0567407..ea84dd48e0 100644--- a/jarvis/ui/web/frontend/src/components/agentchat/providerHealth.test.tsx+++ b/jarvis/ui/web/frontend/src/components/agentchat/providerHealth.test.tsx@@ -197,6 +197,25 @@ describe("the health dot in the provider picker", () => {expect(working.className).toContain("bg-muted-foreground");});+ it("re-reads the dots when a real call changes a seat's recorded health", async () => {+ seed({});+ const loadHealth = vi.fn(async () => {});+ useAgentChatStore.setState({ loadHealth } as never);+ render(+ <AgentChatStoreProvider store={useAgentChatStore}>+ <AgentComposer />+ </AgentChatStoreProvider>,+ );++ // Pushed by the server over the existing WebSocket; a burst is one read.+ window.dispatchEvent(new CustomEvent("jarvis:provider-health-changed", { detail: {} }));+ window.dispatchEvent(new CustomEvent("jarvis:provider-health-changed", { detail: {} }));++ await waitFor(() => expect(loadHealth).toHaveBeenCalledTimes(1));+ // A plain read: the store's loadHealth is never asked to force a sweep.+ expect(loadHealth.mock.calls[0]).toEqual([]);+ });+it("draws no dot at all before the sweep lands", async () => {seed({});render(diff --git a/jarvis/ui/web/frontend/src/hooks/useProviders.section-health.test.tsx b/jarvis/ui/web/frontend/src/hooks/useProviders.section-health.test.tsxindex 17cd4c4806..ff20334c39 100644--- a/jarvis/ui/web/frontend/src/hooks/useProviders.section-health.test.tsx+++ b/jarvis/ui/web/frontend/src/hooks/useProviders.section-health.test.tsx@@ -237,4 +237,41 @@ describe("provider-bound section health", () => {const urls = fetchMock.mock.calls.map((call) => String(call[0]));expect(urls.every((url) => !url.includes("refresh=true"))).toBe(true);});++ it("re-reads when the server pushes a changed outcome, keeping the dots meanwhile", async () => {+ const fetchMock = vi+ .fn()+ .mockResolvedValueOnce(+ jsonResponse(+ responseFor({ status: "unknown", reason: "unverified", detail: "", subject_id: "openai" }),+ ),+ )+ .mockResolvedValueOnce(+ jsonResponse(+ responseFor({+ status: "error",+ reason: "bad_key",+ detail: "OpenAI: the key was rejected on its last real call (just now)",+ subject_id: "openai",+ }),+ ),+ );+ vi.stubGlobal("fetch", fetchMock);+ const { result } = renderHook(() => useSectionHealth());+ await waitFor(() => expect(result.current.health.brain?.reason).toBe("unverified"));++ act(() => {+ window.dispatchEvent(+ new CustomEvent("jarvis:provider-health-changed", {+ detail: { provider: "openai", modality: "brain", status: "bad_key" },+ }),+ );+ });+ // Nothing about the selection changed: the current dot stays until the read lands.+ expect(result.current.health.brain?.reason).toBe("unverified");++ await waitFor(() => expect(result.current.health.brain?.status).toBe("error"));+ expect(fetchMock).toHaveBeenCalledTimes(2);+ expect(String(fetchMock.mock.calls[1][0])).not.toContain("refresh=true");+ });});diff --git a/jarvis/ui/web/frontend/src/hooks/useProviders.ts b/jarvis/ui/web/frontend/src/hooks/useProviders.tsindex b04bcc5923..1bce601e21 100644--- a/jarvis/ui/web/frontend/src/hooks/useProviders.ts+++ b/jarvis/ui/web/frontend/src/hooks/useProviders.ts@@ -580,6 +580,14 @@ export function useSectionHealth() {if (event.type === "jarvis:provider-selection-pending") return;timer = window.setTimeout(() => void reload(false), 400);};+ // A real call changed a provider's recorded health (pushed by the server+ // over the existing WebSocket). Nothing about the selection changed, so+ // the current dots stay until the plain re-read replaces them.+ const onHealthRecorded = () => {+ window.clearTimeout(timer);+ timer = window.setTimeout(() => void reload(false), 400);+ };+ window.addEventListener("jarvis:provider-health-changed", onHealthRecorded);const events = ["jarvis:secret-configured","jarvis:brain-switched",@@ -601,6 +609,7 @@ export function useSectionHealth() {requestController.current?.abort();window.clearTimeout(timer);events.forEach((e) => window.removeEventListener(e, onChange));+ window.removeEventListener("jarvis:provider-health-changed", onHealthRecorded);};}, [reload]);diff --git a/jarvis/ui/web/frontend/src/hooks/useWebSocket.ts b/jarvis/ui/web/frontend/src/hooks/useWebSocket.tsindex e40ad47e8a..ef355e0e29 100644--- a/jarvis/ui/web/frontend/src/hooks/useWebSocket.ts+++ b/jarvis/ui/web/frontend/src/hooks/useWebSocket.ts@@ -458,6 +458,15 @@ export function useWebSocket(): void {window.dispatchEvent(new CustomEvent("jarvis:secret-configured", { detail: env.payload }));}+ if (env.event_name === "ProviderHealthChanged") {+ // Trigger only — a real call just changed a provider's recorded+ // health. The status dots (tabs, sidebar, dock, chat picker) re-read+ // with a plain GET; nothing here or there probes a provider.+ window.dispatchEvent(+ new CustomEvent("jarvis:provider-health-changed", { detail: env.payload }),+ );+ }+if (env.event_name === "DictationPromptModeChanged") {// The switch flipped somewhere this window did not click — the// native Jarvis bar's sparkle, another window — and every pill anddiff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex ddaab769a4..2e6c703151 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -4939,8 +4939,8 @@"continue_busy": "Der Anruf konnte nicht starten. Beende den laufenden Anruf oder hol die App nach vorne und versuch es erneut."},"ready_note": {- "title": "Alle Lichter grün.",- "body": "Denken, Werkzeuge, Agenten und {0} haben beim ersten Versuch geantwortet. Sag dein Wake-Word — oder tipp einfach los.",+ "title": "Alles eingerichtet.",+ "body": "Denken, Werkzeuge, Agenten und {0} sind eingerichtet. Sag dein Wake-Word — oder tipp einfach los.","go": "Los geht's","mode_realtime": "Live-Stimme","mode_pipeline": "Stimme rein und raus"diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 831331ec7e..e641204617 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -4972,8 +4972,8 @@"continue_busy": "The call could not start. End the running call or bring the app to the front, then try again."},"ready_note": {- "title": "All lights green.",- "body": "Thinking, tools, agents and {0} all answered on the first try. Say your wake word — or just start typing.",+ "title": "All set.",+ "body": "Thinking, tools, agents and {0} are set up. Say your wake word — or just start typing.","go": "Let's go","mode_realtime": "live voice","mode_pipeline": "voice in and out"diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 33ee9631c2..912d6b592f 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -4939,8 +4939,8 @@"continue_busy": "La llamada no pudo iniciarse. Termina la llamada en curso o trae la app al frente e inténtalo de nuevo."},"ready_note": {- "title": "Todo en verde.",- "body": "Pensar, herramientas, agentes y {0} han respondido a la primera. Di tu palabra de activación — o simplemente empieza a escribir.",+ "title": "Todo listo.",+ "body": "Pensar, herramientas, agentes y {0} están configurados. Di tu palabra de activación — o simplemente empieza a escribir.","go": "Vamos","mode_realtime": "voz en vivo","mode_pipeline": "voz de entrada y salida"