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(i18n): let the voice provider copy carry the brand token, not a fixed name
Ruben Lütkef2dedb3ed3b4
diff --git a/jarvis/ui/web/frontend/src/__tests__/voiceBrandName.test.tsx b/jarvis/ui/web/frontend/src/__tests__/voiceBrandName.test.tsxindex a562fbf1e5..76b0fd1519 100644--- a/jarvis/ui/web/frontend/src/__tests__/voiceBrandName.test.tsx+++ b/jarvis/ui/web/frontend/src/__tests__/voiceBrandName.test.tsx@@ -11,21 +11,37 @@* The row also fronts five sections at once — dictation, the dictionary, the* shortcuts, the language and the speech-to-text keys — so it must stay* highlighted for all of them.+ *+ * The label is only the entrance: the body copy behind it has to hold the same+ * rule, so this file also covers the section's "API Keys" tab and the locale+ * values it renders.*/-import { cleanup, render, screen } from "@testing-library/react";+import { act, cleanup, render, screen } from "@testing-library/react";import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import enJson from "@/i18n/locales/en.json";+import deJson from "@/i18n/locales/de.json";+import esJson from "@/i18n/locales/es.json";+// usePluginAttention polls /api/marketplace/plugins — mocked so the sidebar// renders without a fetch.vi.mock("@/hooks/usePluginAttention", () => ({usePluginAttention: () => ({ count: 0, names: [] }),}));-// useVoiceMode fetches /api/settings/voice-mode — same reason.+// useVoiceMode fetches /api/settings/voice-mode — same reason. The shape covers+// both consumers in this file: the sidebar's footer card and the API-Keys tab's+// engine switch.vi.mock("@/hooks/useVoiceMode", () => ({useVoiceMode: () => ({mode: "pipeline",+ realtimeAvailable: false,+ statusKnown: true,+ transitioning: false,+ setMode: vi.fn(),+ isLoading: false,+ isSaving: false,activeProvider: null,activeProviderLabel: null,activeModel: null,@@ -36,9 +52,89 @@ vi.mock("@/hooks/useVoiceMode", () => ({}),}));+// Only the two data hooks are replaced; `sectionHealthForSubject` and the+// provider-switch helpers stay real, so the rendered markup is the production+// one and the assertions below describe what a user actually sees.+vi.mock("@/hooks/useProviders", async (importOriginal) => {+ const actual = await importOriginal<typeof import("@/hooks/useProviders")>();+ // Stable identities: `useTierHealth` memoises on the health map, and a fresh+ // object literal per render would invalidate it on every pass.+ const noop = vi.fn();+ const emptyHealth = { health: {} };+ // Built on first call, not here: the fixture below is still in its temporal+ // dead zone while this factory runs.+ let providers: (typeof STT_PROVIDER)[] | null = null;+ return {+ ...actual,+ useProviders: () => ({+ providers: (providers ??= [STT_PROVIDER]),+ loading: false,+ error: null,+ refetch: noop,+ setActiveOptimistic: noop,+ }),+ useSectionHealth: () => emptyHealth,+ };+});+import { Sidebar } from "@/components/layout/Sidebar";+import { VoiceApiKeysTab } from "@/views/voice/VoiceApiKeysTab";+import type { ProviderDescriptor } from "@/hooks/useProviders";import { useEventStore, type SectionId } from "@/store/events";+/**+ * A deliberately name-free speech-to-text provider: every occurrence of the+ * pinned brand in the rendered output then comes from the locale copy under+ * test, never from fixture data.+ */+const STT_PROVIDER: ProviderDescriptor = {+ id: "test-speech",+ label: "Test Speech Service",+ tier: "stt",+ auth_mode: "api_key",+ secret_keys: ["TEST_SPEECH_API_KEY"],+ secrets_set: { TEST_SPEECH_API_KEY: false },+ dashboard_url: null,+ login_cli: null,+ install_hint: null,+ credential_path_hint: null,+ configured: false,+ active: false,+ cli_installed: null,+ credential_help: null,+ signup_url: null,+ billing: "api",+ alt_credential: null,+};++/** An arbitrary brand — never the host's live wake-word configuration. */+const PINNED_BRAND = "Nova";++/**+ * Every product name that must never reach a user-visible string. Kept as+ * fragments so a compound ("Personal Jarvis", "Jarvis-Agent") is caught too.+ */+const FORBIDDEN_NAMES = ["jarvis"] as const;++/** Holds for a locale source value as well as for rendered output. */+function expectNoHardcodedBrand(text: string, where: string): void {+ for (const forbidden of FORBIDDEN_NAMES) {+ expect(+ text.toLowerCase().includes(forbidden),+ `${where} must not hardcode "${forbidden}": ${text}`,+ ).toBe(false);+ }+}++/**+ * Rendered output only: the raw locale value is SUPPOSED to carry `{name}`, so+ * this is the check that the substitution actually ran on the way to the DOM.+ */+function expectBrandInterpolated(text: string, where: string): void {+ expectNoHardcodedBrand(text, where);+ expect(text, `${where} must interpolate the {name} token`).not.toContain("{name}");+}+function renderSidebar() {const client = new QueryClient({defaultOptions: { queries: { retry: false }, mutations: { retry: false } },@@ -50,6 +146,17 @@ function renderSidebar() {);}+function renderVoiceApiKeysTab() {+ const client = new QueryClient({+ defaultOptions: { queries: { retry: false }, mutations: { retry: false } },+ });+ return render(+ <QueryClientProvider client={client}>+ <VoiceApiKeysTab />+ </QueryClientProvider>,+ );+}+/** Every section the one voice row fronts. */const VOICE_SECTIONS: readonly SectionId[] = ["dictation",@@ -67,7 +174,7 @@ describe("voice section sidebar brand", () => {transcriptionFinal: true,connected: true,activeSection: "chats",- assistantName: "Nova",+ assistantName: PINNED_BRAND,});});@@ -80,9 +187,8 @@ describe("voice section sidebar brand", () => {renderSidebar();const label = screen.getByTestId("nav-row-dictation").textContent?.trim() ?? "";- expect(label).toBe("Nova Voice");- expect(label).not.toContain("{name}");- expect(label.toLowerCase()).not.toContain("jarvis");+ expect(label).toBe(`${PINNED_BRAND} Voice`);+ expectBrandInterpolated(label, "the voice sidebar row");});it("falls back to the neutral default when no name is configured", () => {@@ -91,7 +197,7 @@ describe("voice section sidebar brand", () => {const label = screen.getByTestId("nav-row-dictation").textContent?.trim() ?? "";expect(label).toBe("Assistant Voice");- expect(label.toLowerCase()).not.toContain("jarvis");+ expectBrandInterpolated(label, "the neutral-default voice sidebar row");});it("collapses the former Dictation and Dictionary rows into one", () => {@@ -115,3 +221,72 @@ describe("voice section sidebar brand", () => {}});});++describe("voice API-Keys tab brand", () => {+ beforeEach(() => {+ useEventStore.setState({ assistantName: PINNED_BRAND });+ });++ afterEach(() => {+ cleanup();+ useEventStore.setState({ assistantName: "Assistant" });+ });++ it("keeps every rendered word free of a hardcoded assistant name", () => {+ const { container } = renderVoiceApiKeysTab();++ expectBrandInterpolated(container.textContent ?? "", "the voice API-Keys tab body copy");+ });++ it("really substitutes the configured brand into its body copy", () => {+ renderVoiceApiKeysTab();++ // Proves the copy still SPEAKS about the assistant — a description that+ // dropped the reference entirely would pass the negative check above while+ // silently losing the sentence's subject.+ const body = screen.getByTestId("voice-api-keys-tab").textContent ?? "";+ expect(body).toContain(PINNED_BRAND);+ });++ it("follows a rename without a remount", () => {+ const { container } = renderVoiceApiKeysTab();+ expect(container.textContent).toContain(PINNED_BRAND);++ act(() => {+ useEventStore.setState({ assistantName: "Atlas" });+ });++ expect(container.textContent).toContain("Atlas");+ expectBrandInterpolated(container.textContent ?? "", "the renamed voice API-Keys tab");+ });+});++/**+ * The locale-level root cause. The rendered checks above only see the keys this+ * one tab happens to mount; these pin the values themselves, in all three+ * locales, so a translation cannot reintroduce the literal name through a+ * surface no test renders.+ */+describe("voice locale copy", () => {+ const LOCALES = { en: enJson, de: deJson, es: esJson } as const;++ // The descriptions the merged voice section and the API-Keys view share.+ const NAME_BEARING_KEYS = [+ "voice_engine_desc",+ "cat_tts_desc",+ "cat_stt_desc",+ ] as const;++ for (const [locale, bundle] of Object.entries(LOCALES)) {+ const strings = (bundle as { apikeys_view: Record<string, string> }).apikeys_view;++ for (const key of NAME_BEARING_KEYS) {+ it(`${locale}: apikeys_view.${key} refers to the assistant by token`, () => {+ const value = strings[key];+ expect(value, `apikeys_view.${key} is missing from ${locale}.json`).toBeTruthy();+ expect(value).toContain("{name}");+ expectNoHardcodedBrand(value, `${locale}.json apikeys_view.${key}`);+ });+ }+ }+});diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsxindex a11338fae2..027cef9462 100644--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx@@ -580,7 +580,7 @@ function prettyProviderName(id: string): string {const map: Record<string, string> = {"claude-api": "Claude (API)","openrouter": "OpenRouter",- "ollama-local": "Ollama (lokal)",+ "ollama-local": "Ollama (local)","ollama-cloud": "Ollama (Cloud)","gemini": "Gemini","openai": "OpenAI",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 0f93de6110..89c95e8fd9 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -1100,7 +1100,7 @@"mode_active_badge": "Aktiv","mode_recommended": "Empfohlen","voice_engine_label": "Sprach-Engine",- "voice_engine_desc": "Wie Jarvis zuhört und spricht — die klassische Pipeline oder ein einzelnes Realtime-Modell.",+ "voice_engine_desc": "Wie {name} zuhört und spricht — die klassische Pipeline oder ein einzelnes Realtime-Modell.","mode_needs_key": "Realtime braucht einen API-Key — unten einen hinzufügen, dann umschalten.","mode_desc_pipeline": "Drei Schritte: Sprache zu Text, das Brain denkt, Text zu Sprache.","mode_desc_realtime": "Ein Modell hört zu und antwortet im selben Live-Audiostrom.",@@ -1113,8 +1113,8 @@"runtime_pipeline": "Aktuelle Session: Pipeline","runtime_fallback_pipeline": "Die aktuelle Session ist auf die Pipeline zurückgefallen; Realtime bedient diesen Anruf nicht.","cat_brain_desc": "Das Modell, das deine Chat- und Sprachantworten formuliert. Aktionen und Computer-Use übernimmt das separate Tool-Modell.",- "cat_tts_desc": "Die Stimme, mit der Jarvis spricht.",- "cat_stt_desc": "Wie Jarvis deine Sprache in Text umwandelt.",+ "cat_tts_desc": "Die Stimme, mit der {name} spricht.",+ "cat_stt_desc": "Wie {name} deine Sprache in Text umwandelt.","cat_realtime_desc": "Vollduplex-Sprache-zu-Sprache über jeden eingerichteten Realtime-Provider, auf dem Desktop oder im Browser.","cat_computer_use_desc": "Das Tool Model führt deine Aktionen aus: Es routet Sprachbefehle, plant Computer-Use auf deinem Bildschirm, startet Hintergrund-Agenten und steuert die App — unabhängig von deinem Chat-Brain.","cat_subagents_title": "{name}-Agents",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 5c30f42317..9b2437fd8b 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -1100,7 +1100,7 @@"mode_active_badge": "Active","mode_recommended": "Recommended","voice_engine_label": "Voice engine",- "voice_engine_desc": "How Jarvis listens and talks — the classic pipeline, or a single realtime model.",+ "voice_engine_desc": "How {name} listens and talks — the classic pipeline, or a single realtime model.","mode_needs_key": "Realtime needs an API key — add one below to switch.","mode_desc_pipeline": "Three steps: speech-to-text, the Brain thinks, text-to-speech.","mode_desc_realtime": "One model listens and answers in the same live audio stream.",@@ -1113,8 +1113,8 @@"runtime_pipeline": "Current session: Pipeline","runtime_fallback_pipeline": "Current session fell back to Pipeline; Realtime is not serving this call.","cat_brain_desc": "The model that writes your chat and voice answers. The separate Tool Model handles actions and Computer Use.",- "cat_tts_desc": "The voice Jarvis speaks with.",- "cat_stt_desc": "How Jarvis turns your speech into text.",+ "cat_tts_desc": "The voice {name} speaks with.",+ "cat_stt_desc": "How {name} turns your speech into text.","cat_realtime_desc": "Full-duplex speech-to-speech through any configured Realtime provider, on desktop or in the browser.","cat_computer_use_desc": "The Tool Model runs your actions: it routes spoken commands, plans Computer-Use on your screen, starts background agents, and drives app controls — independent of your chat Brain.","cat_subagents_title": "{name}-Agents",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 285226c386..911c7caa02 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -1100,7 +1100,7 @@"mode_active_badge": "Activo","mode_recommended": "Recomendado","voice_engine_label": "Motor de voz",- "voice_engine_desc": "Cómo escucha y habla Jarvis: la pipeline clásica o un único modelo en tiempo real.",+ "voice_engine_desc": "Cómo escucha y habla {name}: la pipeline clásica o un único modelo en tiempo real.","mode_needs_key": "Tiempo real necesita una clave API — añade una abajo para cambiar.","mode_desc_pipeline": "Tres pasos: voz a texto, el Brain piensa, texto a voz.","mode_desc_realtime": "Un solo modelo escucha y responde en el mismo flujo de audio en vivo.",@@ -1113,8 +1113,8 @@"runtime_pipeline": "Sesión actual: Pipeline","runtime_fallback_pipeline": "La sesión actual volvió a Pipeline; Tiempo real no está atendiendo esta llamada.","cat_brain_desc": "El modelo que redacta tus respuestas de chat y voz. El modelo de herramientas independiente gestiona las acciones y Computer Use.",- "cat_tts_desc": "La voz con la que habla Jarvis.",- "cat_stt_desc": "Cómo convierte Jarvis tu voz en texto.",+ "cat_tts_desc": "La voz con la que habla {name}.",+ "cat_stt_desc": "Cómo convierte {name} tu voz en texto.","cat_realtime_desc": "Voz a voz dúplex completo mediante cualquier proveedor de tiempo real configurado, en escritorio o navegador.","cat_computer_use_desc": "El Tool Model ejecuta tus acciones: enruta comandos de voz, planifica Computer-Use en tu pantalla, inicia agentes en segundo plano y controla la app — independiente de tu Brain de chat.","cat_subagents_title": "{name}-Agents",