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(voice): pick the Pipeline's voice brain on the Live calls tab (#1089)
Ruben Lütke14c0fde42b2e
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/providers/de.json b/dodaios/ui/web/frontend/src/i18n/locales/providers/de.jsonindex 73d7464084..ff05fcf6c9 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/providers/de.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/providers/de.json@@ -119,9 +119,9 @@"engine_next_call": "Eine Änderung gilt ab deinem nächsten Gespräch.","engine_failed": "Die Sprach-Engine wurde nicht umgestellt: {0}","pipeline_brain_title": "Brain",- "pipeline_brain_desc": "Die Antworten kommen von deinem Standard-Agenten-Anbieter: {0}.",- "pipeline_brain_none": "Noch kein Standard-Agenten-Anbieter gewählt.",- "pipeline_brain_change": "In Agenten ändern",+ "pipeline_brain_desc": "Anrufe beantwortet das Sprach-Gehirn: {0}. Unten kannst du ein anderes wählen. Der Agenten-Tab legt nur den Standard für Agenten-Aufgaben fest.",+ "pipeline_brain_none": "Noch kein Sprach-Gehirn gewählt. Wähle unten eins.",+ "pipeline_brain_missing": "{0} ist noch nicht eingerichtet, deshalb können Anrufe nicht beantwortet werden. Trag unten den Schlüssel ein oder wähle ein Gehirn, das bereit ist.","subscriptions_title": "Abos","keys_title": "API-Keys","authenticated": "Angemeldet",diff --git a/dodaios/ui/web/frontend/src/i18n/locales/providers/en.json b/dodaios/ui/web/frontend/src/i18n/locales/providers/en.jsonindex e456add50f..489ba4536f 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/providers/en.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/providers/en.json@@ -119,9 +119,9 @@"engine_next_call": "A change applies from your next call.","engine_failed": "The voice engine was not switched: {0}","pipeline_brain_title": "Brain",- "pipeline_brain_desc": "Answers come from your default agent provider: {0}.",- "pipeline_brain_none": "No default agent provider is set yet.",- "pipeline_brain_change": "Change in Agents",+ "pipeline_brain_desc": "Calls are answered by the voice brain: {0}. Pick another one below. The Agents tab only sets the default for agent tasks.",+ "pipeline_brain_none": "No voice brain is selected yet. Pick one below.",+ "pipeline_brain_missing": "{0} is not set up yet, so calls cannot be answered. Add its key below or pick a brain that is ready.","subscriptions_title": "Subscriptions","keys_title": "API keys","authenticated": "Authenticated",diff --git a/dodaios/ui/web/frontend/src/i18n/locales/providers/es.json b/dodaios/ui/web/frontend/src/i18n/locales/providers/es.jsonindex 20a79ba2a1..33c0ebeb3b 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/providers/es.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/providers/es.json@@ -119,9 +119,9 @@"engine_next_call": "Un cambio se aplica a partir de tu próxima llamada.","engine_failed": "No se cambió el motor de voz: {0}","pipeline_brain_title": "Cerebro",- "pipeline_brain_desc": "Las respuestas vienen de tu proveedor de agentes predeterminado: {0}.",- "pipeline_brain_none": "Aún no hay un proveedor de agentes predeterminado.",- "pipeline_brain_change": "Cambiar en Agentes",+ "pipeline_brain_desc": "Las llamadas las responde el cerebro de voz: {0}. Elige otro abajo. La pestaña Agentes solo fija el predeterminado para tareas de agentes.",+ "pipeline_brain_none": "Aún no hay un cerebro de voz elegido. Elige uno abajo.",+ "pipeline_brain_missing": "{0} aún no está configurado, así que las llamadas no pueden responderse. Añade su clave abajo o elige un cerebro que esté listo.","subscriptions_title": "Suscripciones","keys_title": "Claves API","authenticated": "Sesión iniciada",diff --git a/dodaios/ui/web/frontend/src/i18n/locales/providers/pt.json b/dodaios/ui/web/frontend/src/i18n/locales/providers/pt.jsonindex 4e55368a73..9d31f5733f 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/providers/pt.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/providers/pt.json@@ -119,9 +119,9 @@"engine_next_call": "Uma alteração aplica-se a partir da tua próxima chamada.","engine_failed": "O motor de voz não foi alterado: {0}","pipeline_brain_title": "Cérebro",- "pipeline_brain_desc": "As respostas vêm do teu fornecedor de agentes predefinido: {0}.",- "pipeline_brain_none": "Ainda não há um fornecedor de agentes predefinido.",- "pipeline_brain_change": "Alterar em Agentes",+ "pipeline_brain_desc": "As chamadas são respondidas pelo cérebro de voz: {0}. Escolhe outro abaixo. O separador Agentes só define o predefinido para tarefas de agentes.",+ "pipeline_brain_none": "Ainda não há um cérebro de voz escolhido. Escolhe um abaixo.",+ "pipeline_brain_missing": "{0} ainda não está configurado, por isso as chamadas não podem ser respondidas. Adiciona a chave abaixo ou escolhe um cérebro que esteja pronto.","subscriptions_title": "Subscrições","keys_title": "Chaves de API","authenticated": "Autenticado",diff --git a/dodaios/ui/web/frontend/src/i18n/locales/providers/zh.json b/dodaios/ui/web/frontend/src/i18n/locales/providers/zh.jsonindex 8b44aa2b8e..4832e0eacc 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/providers/zh.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/providers/zh.json@@ -119,9 +119,9 @@"engine_next_call": "更改从下一次通话开始生效。","engine_failed": "语音引擎未切换:{0}","pipeline_brain_title": "大脑",- "pipeline_brain_desc": "回答来自你的默认智能体提供商:{0}。",- "pipeline_brain_none": "尚未设置默认智能体提供商。",- "pipeline_brain_change": "在智能体中更改",+ "pipeline_brain_desc": "通话由语音大脑回答:{0}。可在下方选择其他大脑。智能体标签页只设置智能体任务的默认提供商。",+ "pipeline_brain_none": "尚未选择语音大脑。请在下方选择一个。",+ "pipeline_brain_missing": "{0} 尚未设置,因此无法回答通话。请在下方添加其密钥,或选择一个已就绪的大脑。","subscriptions_title": "订阅","keys_title": "API 密钥","authenticated": "已认证",diff --git a/dodaios/ui/web/frontend/src/views/ApiKeysView.providers.test.tsx b/dodaios/ui/web/frontend/src/views/ApiKeysView.providers.test.tsxindex 9a2e2957a9..4166df5078 100644--- a/dodaios/ui/web/frontend/src/views/ApiKeysView.providers.test.tsx+++ b/dodaios/ui/web/frontend/src/views/ApiKeysView.providers.test.tsx@@ -118,6 +118,7 @@ beforeEach(() => {"/api/providers": () => routeOverrides.providers ?? { providers: PROVIDERS },"/api/jarvis-agent/status": () => routeOverrides.agents ?? AGENTS,"/api/jarvis-agent/switch": { ok: true },+ "/api/brain/switch": { ok: true },"/api/claude/status": CLAUDE_STATUS,"/api/codex/status": null,"/api/secrets/": { ok: true, key: "x", written: ["anthropic_api_key"] },@@ -198,9 +199,18 @@ describe("ApiKeysView — Live calls", () => {expect(screen.queryByTestId("live-profile")).toBeNull();expect(within(pipeline).getByText("Voice Input (STT)")).toBeTruthy();expect(within(pipeline).getByText("Voice Output (TTS)")).toBeTruthy();+ // The brain is picked right here (#1028): the Agents tab's default only+ // decides agent tasks, so the old "Change in Agents" link led nowhere.const brain = within(pipeline).getByTestId("voice-pipeline-brain");- fireEvent.click(within(brain).getByRole("button", { name: "Change in Agents" }));- expect(await screen.findByTestId("apikeys-agents")).toBeTruthy();+ expect(within(brain).queryByRole("button", { name: "Change in Agents" })).toBeNull();+ const picker = within(pipeline).getByTestId("voice-pipeline-brain-picker");+ fireEvent.click(await within(picker).findByTestId("provider-row-gemini"));+ await waitFor(() => {+ const sw = calls.find((call) => call.method === "POST" && call.url === "/api/brain/switch");+ expect(sw?.body).toEqual({ provider: "gemini", persist: true });+ });+ // The Agents default is a different setting and is never written from here.+ expect(calls.some((call) => call.url.startsWith("/api/jarvis-agent/switch"))).toBe(false);});it("shows GPT-Live's settings without switching while no live provider is ready", async () => {diff --git a/dodaios/ui/web/frontend/src/views/ApiKeysView.tsx b/dodaios/ui/web/frontend/src/views/ApiKeysView.tsxindex 6c0b1570d3..9130fb757b 100644--- a/dodaios/ui/web/frontend/src/views/ApiKeysView.tsx+++ b/dodaios/ui/web/frontend/src/views/ApiKeysView.tsx@@ -123,7 +123,7 @@ export function ApiKeysView() {className="min-h-0 flex-1 overflow-y-auto scrollbar-jarvis px-8 pb-10 pt-6"><div key={tab} role="tabpanel" id="apikeys-panel" aria-labelledby={`apikeys-tab-${tab}`} className="profile-rise w-full">- {tab === "voice" && <VoiceTab data={families} onSaved={refetch} onOpenAgents={() => choose("agents")} />}+ {tab === "voice" && <VoiceTab data={families} onSaved={refetch} />}{tab === "agents" &&(families.error === "restart_required" ? (<RestartNeeded />@@ -184,11 +184,9 @@ function TabSwitch({ value, onChange }: { value: Tab; onChange: (tab: Tab) => vofunction VoiceTab({data,onSaved,- onOpenAgents,}: {data: ReturnType<typeof useProviderFamilies>;onSaved: () => void;- onOpenAgents: () => void;}) {const openai = data.families?.find((family) => family.id === "openai");const engine = useVoiceEngineView();@@ -196,7 +194,7 @@ function VoiceTab({<div data-testid="apikeys-voice" className="mx-auto w-full max-w-3xl"><VoiceEngineSwitch engine={engine} />{engine.view === "pipeline" ? (- <PipelinePane onOpenAgents={onOpenAgents} />+ <PipelinePane />) : (<SettingsGroup divided={false} className="p-4"><LiveProfilediff --git a/dodaios/ui/web/frontend/src/views/apikeys/VoiceEngine.test.tsx b/dodaios/ui/web/frontend/src/views/apikeys/VoiceEngine.test.tsxnew file mode 100644index 0000000000..a93f06c3e8--- /dev/null+++ b/dodaios/ui/web/frontend/src/views/apikeys/VoiceEngine.test.tsx@@ -0,0 +1,77 @@+/**+ * The Pipeline's brain row (#1028): it names the VOICE brain, offers the brain+ * list inline, and warns when the active voice brain has no credential.+ *+ * No jest-dom in this repo — assertions use plain values.+ */+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { cleanup, render, screen, within } from "@testing-library/react";++import { _resetProvidersCacheForTests } from "@/hooks/useProviders";+import { loadLocaleChunk } from "@/i18n";+import { PipelinePane } from "@/views/apikeys/VoiceEngine";++const BASE = {+ dashboard_url: null, login_cli: null, install_hint: null, credential_path_hint: null,+ cli_installed: null, credential_help: null, signup_url: null, alt_credential: null,+};++let providers: Record<string, unknown>[] = [];++function brain(id: string, label: string, over: Record<string, unknown> = {}) {+ return {+ ...BASE, id, label, tier: "brain", auth_mode: "api_key", secret_keys: [`${id}_api_key`],+ secrets_set: {}, configured: false, active: false, billing: "api", ...over,+ };+}++beforeEach(async () => {+ await loadLocaleChunk("providers");+ _resetProvidersCacheForTests();+ providers = [];+ vi.stubGlobal(+ "fetch",+ vi.fn(async (input: RequestInfo | URL) => {+ const url = String(input);+ const body = url.startsWith("/api/providers/section-health")+ ? { sections: {}, checked_at: 0, cached: false }+ : url.startsWith("/api/providers")+ ? { providers }+ : {};+ return { ok: true, status: 200, json: async () => body, text: async () => "" } as Response;+ }),+ );+});++afterEach(() => {+ cleanup();+ vi.unstubAllGlobals();+});++describe("PipelinePane brain", () => {+ it("names the voice brain, not the agent default, and lists the brains inline", async () => {+ providers = [+ brain("claude-api", "Claude (API-Key)", { active: true, configured: true, secrets_set: { "claude-api_api_key": true } }),+ brain("openai", "OpenAI"),+ ];+ render(<PipelinePane />);+ const row = await screen.findByTestId("voice-pipeline-brain");+ await within(row).findByText(/voice brain: Claude \(API-Key\)/);+ expect(row.textContent).not.toContain("default agent provider");+ expect(screen.queryByTestId("voice-pipeline-brain-missing")).toBeNull();+ const picker = screen.getByTestId("voice-pipeline-brain-picker");+ expect(within(picker).getByTestId("provider-row-claude-api")).toBeTruthy();+ expect(within(picker).getByTestId("provider-row-openai")).toBeTruthy();+ });++ it("warns when the active voice brain has no key", async () => {+ providers = [+ brain("claude-api", "Claude (API-Key)", { active: true }),+ brain("openai", "OpenAI", { configured: true, secrets_set: { openai_api_key: true } }),+ ];+ render(<PipelinePane />);+ const warning = await screen.findByTestId("voice-pipeline-brain-missing");+ expect(warning.getAttribute("role")).toBe("alert");+ expect(warning.textContent).toContain("Claude (API-Key) is not set up yet");+ });+});diff --git a/dodaios/ui/web/frontend/src/views/apikeys/VoiceEngine.tsx b/dodaios/ui/web/frontend/src/views/apikeys/VoiceEngine.tsxindex 8585998153..5155f72797 100644--- a/dodaios/ui/web/frontend/src/views/apikeys/VoiceEngine.tsx+++ b/dodaios/ui/web/frontend/src/views/apikeys/VoiceEngine.tsx@@ -1,7 +1,6 @@import { useEffect, useState } from "react";-import { Brain } from "lucide-react";+import { AlertTriangle, Brain } from "lucide-react";-import { Button } from "@/components/ui/button";import {makeProviderCategories,ProviderCategory,@@ -100,16 +99,20 @@ export function VoiceEngineSwitch({ engine }: { engine: ReturnType<typeof useVoi}/**- * The pipeline's three steps: voice input, the brain, voice output. Input and- * output are the same provider lists the rest of the app uses; the brain is- * the default agent provider, chosen on the Agents tab.+ * The pipeline's three steps: voice input, the brain, voice output. All three+ * are the same provider lists the rest of the app uses. The brain is the+ * voice brain (`[brain].primary`), picked right here: the Agents tab's+ * default only decides which provider runs agent tasks, so sending people+ * there to change the voice brain left them no way to change it (#1028).+ * Switching it stays a user action; nothing here picks one automatically.*/-export function PipelinePane({ onOpenAgents }: { onOpenAgents: () => void }) {+export function PipelinePane() {const t = useT();const { providers, loading, error, refetch, setActiveOptimistic } = useProviders();const health = useTierHealth(providers);const categories = makeProviderCategories(t);const brain = providers.find((provider) => provider.tier === "brain" && provider.active);+ const brainMissing = Boolean(brain && !brain.configured);return (<div data-testid="voice-pipeline" className="flex flex-col gap-group">@@ -124,26 +127,48 @@ export function PipelinePane({ onOpenAgents }: { onOpenAgents: () => void }) {health={health.stt}/>- <SettingsGroup data-testid="voice-pipeline-brain">- <SettingsRow- title={- <>- <Brain aria-hidden="true" className="h-4 w-4 text-muted-foreground" />- {t("providers_page.pipeline_brain_title")}- </>- }- description={- brain- ? t("providers_page.pipeline_brain_desc").replace("{0}", brain.label)- : t("providers_page.pipeline_brain_none")- }- control={- <Button size="sm" variant="outline" onClick={onOpenAgents}>- {t("providers_page.pipeline_brain_change")}- </Button>- }- />- </SettingsGroup>+ <div className="flex flex-col gap-3">+ <SettingsGroup data-testid="voice-pipeline-brain">+ <SettingsRow+ title={+ <>+ <Brain aria-hidden="true" className="h-4 w-4 text-muted-foreground" />+ {t("providers_page.pipeline_brain_title")}+ </>+ }+ description={+ brain+ ? t("providers_page.pipeline_brain_desc").replace("{0}", brain.label)+ : t("providers_page.pipeline_brain_none")+ }+ status={+ brain && brainMissing ? (+ <span+ role="alert"+ data-testid="voice-pipeline-brain-missing"+ className="flex items-start gap-1.5 text-warning"+ >+ <AlertTriangle aria-hidden="true" className="mt-0.5 h-3.5 w-3.5 shrink-0" />+ {t("providers_page.pipeline_brain_missing").replace("{0}", brain.label)}+ </span>+ ) : undefined+ }+ />+ </SettingsGroup>++ <div data-testid="voice-pipeline-brain-picker">+ <ProviderCategory+ meta={categories.brain}+ tier="brain"+ providers={providers}+ loading={loading}+ error={error}+ onChanged={refetch}+ onActivateOptimistic={setActiveOptimistic}+ health={health.brain}+ />+ </div>+ </div><ProviderCategorymeta={categories.tts}