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(chat): the typed chat looks like it did, and names the brain that answers it

rubenluetke10-beep381667bb5019
diff --git a/jarvis/ui/web/frontend/src/components/ChatInput.tsx b/jarvis/ui/web/frontend/src/components/ChatInput.tsx
index 48b610ed93..e7edb53613 100644
--- a/jarvis/ui/web/frontend/src/components/ChatInput.tsx
+++ b/jarvis/ui/web/frontend/src/components/ChatInput.tsx
@@ -1,7 +1,8 @@
import { useEffect, useRef, useState, type KeyboardEvent } from "react";
import { ArrowUp, Mic, Square } from "lucide-react";
import { getWSClient } from "@/hooks/useWebSocket";
-import { useVoiceEngineDisplay } from "@/hooks/useVoiceEngineDisplay";
+import { ProviderLogo } from "@/components/providers/ProviderLogo";
+import { prettyProviderName } from "@/lib/prettyProviderName";
import { useEventStore } from "@/store/events";
import { cn } from "@/lib/utils";
import { useT } from "@/i18n";
@@ -26,9 +27,15 @@ export function ChatInput() {
const [value, setValue] = useState("");
const connected = useEventStore((s) => s.connected);
const setActiveSection = useEventStore((s) => s.setActiveSection);
- // What will answer: the classic brain, or the realtime engine when voice
- // mode is realtime — the same resolver the header and the sidebar use.
- const engine = useVoiceEngineDisplay();
+ // What will answer HERE. A typed turn always runs the classic brain
+ // (desktop_app._on_user_message -> BrainManager) — the realtime engine is
+ // the voice stage's, it never sees a typed prompt. Naming it here said the
+ // chat ran on "Gemini Live" while the answer actually came from the
+ // configured brain provider, which is the pick people make under Agents /
+ // API keys (maintainer, 2026-08-24).
+ const brainProvider = useEventStore((s) => s.brainProvider);
+ const brainModel = useEventStore((s) => s.brainModel);
+ const brainLabel = brainProvider ? prettyProviderName(brainProvider) : "";
const wsWarming = useEventStore((s) => s.wsWarming);
// The turn's progress is no longer mirrored in the composer — the chat
// column renders the live steps (components/home/TurnSteps) as the
@@ -240,9 +247,12 @@ export function ChatInput() {
data-testid="composer-model"
className="inline-flex h-8 max-w-[280px] items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"
>
- <span className="truncate font-medium text-foreground">{engine.providerLabel}</span>
- {engine.model && (
- <span className="truncate font-mono text-[10px] text-muted-foreground">{engine.model}</span>
+ {brainProvider && (
+ <ProviderLogo providerId={brainProvider} label={brainLabel} size="sm" />
+ )}
+ <span className="truncate font-medium text-foreground">{brainLabel || "—"}</span>
+ {brainModel && (
+ <span className="truncate font-mono text-[10px] text-muted-foreground">{brainModel}</span>
)}
</button>
<button
diff --git a/jarvis/ui/web/frontend/src/components/home/ChatStage.test.tsx b/jarvis/ui/web/frontend/src/components/home/ChatStage.test.tsx
index 7ed634daf1..c6e3b0c046 100644
--- a/jarvis/ui/web/frontend/src/components/home/ChatStage.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/home/ChatStage.test.tsx
@@ -29,6 +29,8 @@ function render(ui: React.ReactElement) {
const IDLE = {
connected: true,
+ brainProvider: "grok",
+ brainModel: "grok-4.3",
wsWarming: false,
assistantName: "Jarvis",
activeKind: "text" as const,
@@ -75,6 +77,33 @@ describe("ChatStage (Jarvis, typed)", () => {
expect(screen.queryByTestId("composer-plan")).toBeNull();
});
+ it("names the brain that answers, never the realtime voice engine", () => {
+ useEventStore.setState({
+ activeThreadId: "t1",
+ messages: [
+ { id: "m1", role: "user", content: "hi", ts: 1 },
+ { id: "m2", role: "assistant", content: "Hello.", ts: 2 },
+ ],
+ });
+ render(<ChatStage />);
+
+ // A typed turn runs the classic brain; the realtime engine only answers
+ // speech, so its name must not appear on this surface.
+ const composer = screen.getByTestId("chat-composer");
+ expect(within(composer).getByTestId("composer-model").textContent).toContain("grok-4.3");
+ expect(screen.getByTestId("chat-message-assistant").textContent).toContain("grok-4.3");
+ expect(document.body.textContent).not.toContain("Live");
+ });
+
+ it("hangs the turn off a rail, the way the timeline always did", () => {
+ useEventStore.setState({
+ activeThreadId: "t1",
+ messages: [{ id: "m2", role: "assistant", content: "Done.", ts: 2 }],
+ });
+ render(<ChatStage />);
+ expect(screen.getByTestId("chat-turn-rail")).toBeTruthy();
+ });
+
it("renders a turn: the person's bubble, then Jarvis' answer as prose", () => {
useEventStore.setState({
activeThreadId: "t1",
diff --git a/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx b/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx
index 2a3ea6118a..beb2df1f2b 100644
--- a/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx
+++ b/jarvis/ui/web/frontend/src/components/home/ChatStage.tsx
@@ -7,6 +7,8 @@ import { ScrollArea } from "@/components/ui/scroll-area";
import { ChatInput } from "@/components/ChatInput";
import { TurnSteps } from "@/components/home/TurnSteps";
import { Greeting } from "@/components/home/Greeting";
+import { ProviderLogo } from "@/components/providers/ProviderLogo";
+import { prettyProviderName } from "@/lib/prettyProviderName";
import { VoiceThreadStage } from "@/components/home/VoiceThreadStage";
import { useT } from "@/i18n";
import { cn } from "@/lib/utils";
@@ -241,25 +243,70 @@ function useElapsedMs(startedTs: number | null): number {
* only this block does.
*/
function LiveTurn() {
- const assistantName = useEventStore((s) => s.assistantName);
const steps = useEventStore((s) => s.thinkingSteps);
const startedTs = useEventStore((s) => s.thinkingStartedTs);
const liveText = useEventStore((s) => s.liveReply?.text ?? "");
const elapsed = useElapsedMs(startedTs);
return (
- <div className="flex flex-col gap-1.5 px-1" data-testid="chat-turn-live">
- <Byline name={assistantName} />
+ <Turn live testId="chat-turn-live">
<TurnSteps steps={steps} live durationMs={elapsed} />
{liveText.trim() !== "" && <Prose text={liveText} testId="chat-live-text" />}
- </div>
+ </Turn>
);
}
-function Byline({ name }: { name: string }) {
+/**
+ * One assistant turn: the byline that says who answered, and a hairline rail
+ * everything the turn produced hangs off — the steps it took, then the answer.
+ * The rail glows while the turn runs, so the block reads as one live unit
+ * rather than a list of disconnected rows.
+ *
+ * The byline names the BRAIN, with its vendor's own mark: the provider and
+ * model configured under Agents / API keys, which is what a typed turn runs
+ * on. It is deliberately not the voice engine — that one only answers speech.
+ */
+function Turn({
+ children,
+ live = false,
+ testId,
+ messageId,
+}: {
+ children: React.ReactNode;
+ live?: boolean;
+ testId?: string;
+ messageId?: string;
+}) {
+ const assistantName = useEventStore((s) => s.assistantName);
+ const provider = useEventStore((s) => s.brainProvider);
+ const model = useEventStore((s) => s.brainModel);
+ const label = provider ? prettyProviderName(provider) : "";
return (
- <div className="flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-[0.14em] text-primary">
- <span className="h-1 w-1 rounded-full bg-primary" aria-hidden />
- {name}
+ <div className="flex flex-col gap-1.5" data-testid={testId} data-message-id={messageId}>
+ <div className="flex flex-wrap items-center gap-x-2 gap-y-1 px-1 font-mono text-[10px] uppercase tracking-[0.14em] text-primary">
+ <span
+ className={cn("h-1 w-1 rounded-full bg-primary", live && "motion-safe:animate-pulse")}
+ aria-hidden
+ />
+ <span>{assistantName}</span>
+ {provider && (
+ <span className="inline-flex items-center gap-1.5 normal-case tracking-normal text-muted-foreground">
+ <ProviderLogo providerId={provider} label={label} size="sm" />
+ <span>{label}</span>
+ {model && <span className="text-muted-foreground/70">· {model}</span>}
+ </span>
+ )}
+ </div>
+ <div className="relative flex flex-col gap-1.5 pl-4">
+ <span
+ aria-hidden
+ data-testid="chat-turn-rail"
+ className={cn(
+ "absolute bottom-1 left-[3px] top-1 w-px rounded-full",
+ live ? "agent-rail-live" : "bg-border",
+ )}
+ />
+ {children}
+ </div>
</div>
);
}
@@ -342,14 +389,9 @@ function MessageRow({ message }: { message: ChatMessage }) {
}
return (
- <div
- className="flex flex-col gap-1.5 px-1"
- data-testid="chat-message-assistant"
- data-message-id={message.id}
- >
- <Byline name={assistantName} />
+ <Turn testId="chat-message-assistant" messageId={message.id}>
{trace && <TurnSteps steps={trace.steps} durationMs={trace.durationMs} className="mb-1" />}
<Prose text={message.content} />
- </div>
+ </Turn>
);
}
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
index f21ec118e1..a7e169da10 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
@@ -325,6 +325,9 @@ describe("Sidebar brain footer", () => {
describe("Sidebar footer in realtime voice mode", () => {
beforeEach(() => {
+ // The card follows the surface, so every case here states its own — the
+ // store keeps whatever the previous test left behind.
+ useHomeStore.setState({ surface: "voice" });
useEventStore.setState({
voiceState: "idle",
transcription: "",
@@ -387,6 +390,26 @@ describe("Sidebar footer in realtime voice mode", () => {
expect(screen.getByTestId("sidebar-brain-model").textContent).toBe("gpt-realtime-2.1");
});
+ test("the chat surface names the brain even when realtime is configured", () => {
+ // The mirror of the case above: standing in a typed chat, the realtime
+ // engine is the dormant one — a typed turn always runs the classic brain.
+ // Naming "Gemini Live" there read as if the chat ran on the realtime model.
+ useHomeStore.setState({ surface: "chat" });
+ voiceModeMock.value = {
+ ...voiceModeMock.value,
+ mode: "realtime",
+ activeProvider: "gemini-live",
+ activeProviderLabel: "Gemini Live",
+ activeModel: "gemini-3.1-flash-live-preview",
+ };
+
+ renderSidebar();
+
+ expect(screen.getByTestId("sidebar-footer-tier").textContent).toBe("Brain");
+ expect(screen.queryByText("Gemini Live")).toBeNull();
+ expect(screen.getByText("OpenRouter")).toBeTruthy();
+ });
+
test("pipeline mode keeps the classic brain footer", () => {
// Guard the split itself: mode "pipeline" must still show the brain card
// even when a realtime provider is fully configured.
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
index bb5768ef9d..bc1b801bc1 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
@@ -18,6 +18,7 @@ import { useVoiceMode } from "@/hooks/useVoiceMode";
import { useSectionHealth } from "@/hooks/useProviders";
import { usePluginAttention } from "@/hooks/usePluginAttention";
import { useVoiceEngineDisplay } from "@/hooks/useVoiceEngineDisplay";
+import { prettyProviderName } from "@/lib/prettyProviderName";
import { cn } from "@/lib/utils";
import { useMemo, useState } from "react";
import { useT } from "@/i18n";
@@ -212,6 +213,8 @@ export function Sidebar({
// pick so a mid-call cross-family fallback is visible (AP-22).
const voiceMode = useVoiceMode();
const engine = useVoiceEngineDisplay();
+ const brainProvider = useEventStore((s) => s.brainProvider);
+ const brainModel = useEventStore((s) => s.brainModel);
// The window connects in ~1s but the voice feature warms up ~20s in the
// background. During that gap show a "Voice starting…" spinner instead of the
@@ -236,15 +239,22 @@ export function Sidebar({
? t("voice_state.connecting")
: t(`voice_state.${voiceState}`);
- const realtimeFooter = engine.tier === "realtime";
+ // ...but only on the VOICE surface. On the chat surface the realtime engine
+ // is the dormant one — a typed turn always runs the classic brain — so
+ // naming "Gemini Live" under a chat you are typing into is the same mislead
+ // in the other direction, and it read as if the chat ran on the realtime
+ // model (maintainer, 2026-08-24). The card follows the surface.
+ const realtimeFooter = engine.tier === "realtime" && onVoiceSurface;
const footerLabel = realtimeFooter
? t("sidebar.realtime_label")
: t("sidebar.brain_label");
const footerTooltip = realtimeFooter
? t("sidebar.realtime_tooltip")
: t("sidebar.brain_tooltip");
- const footerProvider = engine.providerLabel;
- const footerModel = engine.model;
+ const footerProvider = realtimeFooter
+ ? engine.providerLabel
+ : prettyProviderName(brainProvider) || engine.providerLabel;
+ const footerModel = realtimeFooter ? engine.model : brainModel || engine.model;
const [logoRetry, setLogoRetry] = useState(0);