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(local-models): the answer reads at a measure, and the model's emphasis is emphasis instead of printed asterisks

rubenluetke10-beep60679dd50555
diff --git a/jarvis/ui/web/frontend/src/components/local-models/AssistantPanel.tsx b/jarvis/ui/web/frontend/src/components/local-models/AssistantPanel.tsx
index b3e440491e..ff898b3c8c 100644
--- a/jarvis/ui/web/frontend/src/components/local-models/AssistantPanel.tsx
+++ b/jarvis/ui/web/frontend/src/components/local-models/AssistantPanel.tsx
@@ -57,6 +57,7 @@ import {
type Proposal,
type ProposalStep,
} from "./assistantProposal";
+import { renderInline } from "./assistantText";
import { useLocalModelsAssistantStore } from "./assistantStore";
import { BrainSwitchCard, SetupProposalCard } from "./SetupProposalCard";
@@ -479,12 +480,12 @@ export function AssistantPanel({
<AssistantSteps blocks={item.blocks} live={live} onDecide={onDecide} />
{answer && (
<div
- className="flex max-w-[68ch] flex-col gap-2.5 text-[14px] leading-[1.65] text-foreground"
+ className="flex max-w-[38rem] flex-col gap-2.5 text-[14px] leading-[1.65] text-foreground"
data-testid="assistant-answer"
>
{answer.split(/\n{2,}/).map((para, k) => (
<p key={k} className="whitespace-pre-wrap">
- {para}
+ {renderInline(para)}
</p>
))}
</div>
diff --git a/jarvis/ui/web/frontend/src/components/local-models/assistantText.test.ts b/jarvis/ui/web/frontend/src/components/local-models/assistantText.test.ts
new file mode 100644
index 0000000000..bc30c6f4e0
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/local-models/assistantText.test.ts
@@ -0,0 +1,28 @@
+/** The inline formatting a chat answer actually uses. */
+import { describe, expect, it } from "vitest";
+
+import { renderInline } from "./assistantText";
+
+function textOf(nodes: unknown[]): string {
+ return nodes
+ .map((n) =>
+ typeof n === "string"
+ ? n
+ : ((n as { props?: { children?: string } }).props?.children ?? ""),
+ )
+ .join("");
+}
+
+describe("renderInline", () => {
+ it("turns the model's emphasis into elements, never printed asterisks", () => {
+ const nodes = renderInline("I propose **Gemma 4 12B** and ++Ornith 9B++ today.");
+ expect(textOf(nodes)).toBe("I propose Gemma 4 12B and Ornith 9B today.");
+ expect(nodes.filter((n) => typeof n !== "string")).toHaveLength(2);
+ });
+
+ it("keeps inline code as code and leaves plain prose alone", () => {
+ const code = renderInline("Run `ollama pull qwen3.5` first.");
+ expect(textOf(code)).toBe("Run ollama pull qwen3.5 first.");
+ expect(renderInline("nothing to format")).toEqual(["nothing to format"]);
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/local-models/assistantText.tsx b/jarvis/ui/web/frontend/src/components/local-models/assistantText.tsx
new file mode 100644
index 0000000000..6e7a8afbb9
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/local-models/assistantText.tsx
@@ -0,0 +1,52 @@
+/**
+ * The little bit of formatting a chat answer actually uses.
+ *
+ * A model writes `**bold**` and `` `code` `` in prose whatever you tell it, and
+ * a panel that prints the asterisks reads as broken. This is deliberately NOT a
+ * markdown renderer: the assistant's answer is a paragraph or three of prose,
+ * so bold, italic and inline code are the whole vocabulary. Anything else
+ * (headings, tables, links) is left as written rather than half-supported.
+ *
+ * `++text++` is folded into bold too — Gemini's own emphasis marker, seen in
+ * every setup answer on 2026-08-25 and meaningless to a reader.
+ */
+import type { ReactNode } from "react";
+
+/** `**a**`, `++a++`, `` `a` `` and `*a*` — in that order of precedence. */
+const TOKEN = /(\*\*[^*]+\*\*|\+\+[^+]+\+\+|`[^`]+`|\*[^*\n]+\*)/g;
+
+export function renderInline(text: string): ReactNode[] {
+ const out: ReactNode[] = [];
+ let last = 0;
+ let key = 0;
+ for (const match of text.matchAll(TOKEN)) {
+ const at = match.index ?? 0;
+ if (at > last) out.push(text.slice(last, at));
+ const token = match[0];
+ if (token.startsWith("**") || token.startsWith("++")) {
+ out.push(
+ <strong key={key++} className="font-semibold">
+ {token.slice(2, -2)}
+ </strong>,
+ );
+ } else if (token.startsWith("`")) {
+ out.push(
+ <code
+ key={key++}
+ className="rounded bg-muted px-1 py-0.5 font-mono text-[12.5px] text-foreground"
+ >
+ {token.slice(1, -1)}
+ </code>,
+ );
+ } else {
+ out.push(
+ <em key={key++} className="italic">
+ {token.slice(1, -1)}
+ </em>,
+ );
+ }
+ last = at + token.length;
+ }
+ if (last < text.length) out.push(text.slice(last));
+ return out;
+}