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(agent-chat): the turn says whether it is still working, and stops printing itself twice
rubenluetke10-beepab409431438a
diff --git a/jarvis/agent_chat/runner_cli.py b/jarvis/agent_chat/runner_cli.pyindex 00e360ca8a..8e1bbb361d 100644--- a/jarvis/agent_chat/runner_cli.py+++ b/jarvis/agent_chat/runner_cli.py@@ -751,6 +751,13 @@ def translate_claude_line(obj: dict[str, Any], st: _ClaudeState) -> list[dict[stmid = st.current_message_id or uuid.uuid4().hexst.current_message_id = midif delta.get("type") == "text_delta" and delta.get("text"):+ # Streamed text counts as text the timeline already has. Without+ # this, a turn whose closing ``assistant`` message never arrives+ # (a kill, a crash, a truncated stream) fell through to the+ # ``result`` fallback below and emitted the SAME answer a second+ # time under a new message id — the duplicated output the+ # maintainer saw on 2026-08-25. The Codex shape already does it.+ st.emitted_text = Trueout.append(make_event("text_delta",diff --git a/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx b/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsxindex 5884ca6c8b..6dffe910ed 100644--- a/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx+++ b/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx@@ -1,30 +1,28 @@-import { memo, useEffect, useMemo, useState } from "react";+import { memo, useEffect, useMemo, useState, type ReactNode } from "react";import ReactMarkdown from "react-markdown";import remarkGfm from "remark-gfm";import {ArrowDown,- ArrowUp,+ Ban,Check,ChevronRight,CircleAlert,- Clock,+ FileText,+ ImageIcon,ShieldQuestion,X,} from "lucide-react";+import { LiveCore } from "@/components/LiveCore";import { ProviderLogo } from "@/components/providers/ProviderLogo";import { formatThoughtDuration } from "@/components/home/TurnSteps";-import {- agentToolView,- formatTokens,- inputTokens,- outputTokens,-} from "@/components/agentchat/toolView";+import { agentToolView, formatTokens, outputTokens } from "@/components/agentchat/toolView";import type {ReasoningBlock,TextBlock,TimelineItem,ToolBlock,+ TurnBlock,TurnItem,} from "@/components/agentchat/reduce";import type { ApprovalDecision } from "@/lib/agentChatApi";@@ -37,19 +35,38 @@ import { cn } from "@/lib/utils";* right, each assistant turn flush-left under a byline that says who* answered (the provider's mark, the model, the effort).*- * A turn hangs off a hairline rail that GLOWS while the turn runs, so the- * whole block reads as one live unit instead of a list of disconnected- * rows. On the rail, in the order they happened: what the model thought- * (folded to "Thought for Ns"; a vendor that redacts its thinking still- * gets the row, because the time is the fact), the tool calls under the- * names the agent's own log uses, approval cards where the runner asked,- * and the answer as Markdown.+ * Under the byline, in the order they happened: ONE row for everything the+ * model thought (folded to "Thought for Ns"; a vendor that redacts its+ * thinking still gets the row, because the time is the fact), the tool calls+ * under the names the agent's own log uses, approval cards where the runner+ * asked, and the answer as Markdown.+ *+ * Three rules decide how all of that is drawn (maintainer, 2026-08-25:+ * it looks sloppy, odd boxes everywhere, and a strange stripe down the side):*- * While it works there is ALWAYS a line saying so (maintainer, 2026-08-23:- * "man sieht nicht, dass es nachdenkt"): a turning glyph, a word that- * changes as the minutes pass, the elapsed time and the tokens counted so- * far — the Claude CLI's "✳ Vibing… (1m 57s · ↓ 4.8k tokens)", in the- * product's own colours.+ * 1. ONE container per turn. Nothing inside draws a box of its own — a+ * tool call is a row, an opened detail is a hairline and some text.+ * Boxes inside boxes inside boxes is what made the column look busy,+ * and a nested frame carries no information the indent does not.+ * The turn itself is held together by its byline and the spacing; an+ * earlier version hung it off a glowing hairline rail, which read as a+ * stray stripe running down the transcript.+ * 2. The turn says it is thinking exactly ONCE. Every stretch of thought+ * used to get its own row, stacked above a live line saying the same+ * thing again; the finished thoughts now fold into a single row and the+ * running one is left to the live line alone.+ * 3. The turn ALWAYS says which state it is in. While it runs: the live+ * core, a word that changes as the minutes pass, the elapsed time and+ * the tokens spent — the Claude CLI's "Composing… (2m 35s · ↓ 3.7k+ * tokens)", in the product's own mark and colours. The moment it stops+ * there is a line saying so — Done, Stopped, Failed, or "finished+ * without an answer" when a turn ends on a dead tool call. A live line+ * that simply disappears leaves the person guessing.+ *+ * Only OUTPUT tokens are ever shown (maintainer, 2026-08-25). The input+ * side of a coding CLI re-counts the whole conversation on every step, so+ * it reads as an absurd number for one question (BUG-173); what the turn+ * produced is the honest, monotonic figure.*/export function AgentTimeline({items,@@ -62,6 +79,7 @@ export function AgentTimeline({providerLabel: (providerId: string) => string;onDecide: (approvalId: string, decision: ApprovalDecision) => void;}) {+ const t = useT();return (<>{items.map((item) => {@@ -74,7 +92,39 @@ export function AgentTimeline({data-message-id={item.id}><div className="max-w-[78%] rounded-2xl rounded-br-md border border-border bg-secondary px-4 py-2.5 text-[15px] leading-relaxed text-foreground">- <div className="whitespace-pre-wrap">{item.text}</div>+ {item.text && <div className="whitespace-pre-wrap">{item.text}</div>}+ {item.attachments.length > 0 && (+ <div+ data-testid="agent-message-attachments"+ className={cn(+ "flex flex-wrap gap-1.5",+ item.text && "mt-2 border-t border-border/60 pt-2",+ )}+ >+ {item.attachments.map((file) => (+ <span+ key={file.name}+ // The receipt says whether the model could actually+ // READ it. "sent" and "could not be read" are the two+ // outcomes, and the second happens for real wherever no+ // provider can see an image.+ title={+ file.describedBy === "none"+ ? t("agent_chat.attach_not_described")+ : file.name+ }+ className="flex items-center gap-1.5 rounded-md border border-border/70 bg-background/40 px-1.5 py-0.5 text-[11px] text-muted-foreground"+ >+ {file.kind === "image" ? (+ <ImageIcon className="h-3 w-3 shrink-0" aria-hidden />+ ) : (+ <FileText className="h-3 w-3 shrink-0" aria-hidden />+ )}+ <span className="max-w-[12rem] truncate font-mono">{file.name}</span>+ </span>+ ))}+ </div>+ )}</div></div>);@@ -119,6 +169,7 @@ const Turn = memo(function Turn({const t = useT();const live = turn.status === "running";const elapsed = useElapsedMs(live ? turn.startedMs : null);+ const blocks = useMemo(() => foldThinking(turn.blocks), [turn.blocks]);return (<div@@ -143,24 +194,16 @@ const Turn = memo(function Turn({</span></div>- {/* The rail: everything the turn produced hangs off one line. */}- <div className="relative flex flex-col gap-1.5 pl-4">- <span- aria-hidden- data-testid="agent-turn-rail"- className={cn(- "absolute bottom-1 left-[3px] top-1 w-px rounded-full",- live ? "agent-rail-live" : "bg-border",- )}- />-- {turn.blocks.map((block) => {+ {/* No rail, no frame: the byline above and the spacing are what group+ the turn, and the closing line below says how it ended. */}+ <div className="flex flex-col gap-1.5 px-1">+ {blocks.map((block) => {if (block.kind === "text") return <Prose key={block.id} block={block} />;if (block.kind === "reasoning") return <Reasoning key={block.id} block={block} />;return <ToolRow key={block.callId} block={block} onDecide={onDecide} />;})}- {live && <LiveStatus turn={turn} elapsed={elapsed} />}+ {live && <LiveStatus elapsed={elapsed} usage={turn.liveUsage} />}{turn.status === "error" && turn.error && (<div@@ -172,32 +215,82 @@ const Turn = memo(function Turn({<span className="whitespace-pre-wrap break-words">{turn.error}</span></div>)}- {turn.status === "cancelled" && (- <div className="text-xs italic text-muted-foreground">- {t("agent_chat.turn_cancelled")}- </div>- )}- {!live && <TurnFooter turn={turn} />}+ {!live && <TurnOutcome turn={turn} />}</div></div>);});+/**+ * All of a turn's thinking, folded into one row.+ *+ * A turn thinks, calls a tool, thinks again — and every stretch used to draw+ * its own "Thought for Ns" row, so an ordinary turn stacked two or three of+ * them above a live line that said the same thing once more (maintainer,+ * 2026-08-25: the thinking is shown twice). The finished+ * thoughts now merge into one row where the first of them happened, their+ * segments in order inside it and their seconds added up.+ *+ * A thought that is still running gets NO row at all: the live line below+ * already says the turn is thinking, and saying it twice in a row IS the+ * duplication. It joins the folded row the moment it closes.+ */+export function foldThinking(blocks: TurnBlock[]): TurnBlock[] {+ const thoughts = blocks.filter(+ (b): b is ReasoningBlock => b.kind === "reasoning" && !b.live,+ );+ const merged: ReasoningBlock | null =+ thoughts.length === 0+ ? null+ : {+ kind: "reasoning",+ id: thoughts[0].id,+ text: thoughts+ .map((th) => th.text.trim())+ .filter(Boolean)+ .join("\n\n···\n\n"),+ durationMs: thoughts.reduce((sum, th) => sum + (th.durationMs ?? 0), 0),+ live: false,+ startedMs: thoughts[0].startedMs,+ };++ const out: TurnBlock[] = [];+ let placed = false;+ for (const block of blocks) {+ if (block.kind !== "reasoning") {+ out.push(block);+ continue;+ }+ if (merged && !placed) {+ out.push(merged);+ placed = true;+ }+ }+ return out;+}+/*** The line that says the turn is alive.*- * A turning glyph, a word, the elapsed time and the tokens so far. The word- * changes every few seconds (locale-supplied, comma-separated) so a long- * turn never looks frozen — the same trick the Claude CLI plays, and the- * cheapest possible proof that something is still happening.+ * The live core, a word, the elapsed time and what the turn has produced so+ * far. The word changes every few seconds (locale-supplied,+ * comma-separated) so a long turn never looks frozen — the same trick the+ * Claude CLI plays, and the cheapest possible proof that something is still+ * happening. This is the ONLY line in a running turn that claims to be+ * working; the thought rows deliberately stay quiet until they close.*/-function LiveStatus({ turn, elapsed }: { turn: TurnItem; elapsed: number }) {+function LiveStatus({+ elapsed,+ usage,+}: {+ elapsed: number;+ usage: Record<string, number> | null;+}) {const t = useT();const words = useMemo(() => statusWords(t("agent_chat.status_words")), [t]);const word = words[Math.floor(elapsed / STATUS_WORD_MS) % words.length];- const out = outputTokens(turn.liveUsage);- const inp = inputTokens(turn.liveUsage);+ const out = outputTokens(usage);return (<div@@ -206,20 +299,17 @@ function LiveStatus({ turn, elapsed }: { turn: TurnItem; elapsed: number }) {role="status"aria-live="polite">- <PulseGlyph />+ <LiveCore /><span className="thinking-shimmer font-medium">{word}</span>- <span className="font-mono text-[11px] tabular-nums text-muted-foreground/80">- ({formatThoughtDuration(elapsed)}- {((inp ?? 0) > 0 || (out ?? 0) > 0) && (+ <span className="inline-flex items-center gap-1.5 font-mono text-[11px] tabular-nums text-muted-foreground/80">+ <span>({formatThoughtDuration(elapsed)}</span>+ {out !== null && out > 0 && (<>- {" · "}- <ArrowUp className="inline h-3 w-3 -translate-y-px" aria-hidden />- {formatTokens(inp ?? 0)}- <ArrowDown className="ml-1 inline h-3 w-3 -translate-y-px" aria-hidden />- {formatTokens(out ?? 0)} {t("agent_chat.tokens")}+ <span aria-hidden>·</span>+ <OutTokens n={out} /></>)}- )+ <span>)</span></span><span className="text-muted-foreground/60">{t("agent_chat.interrupt_hint")}</span></div>@@ -238,53 +328,66 @@ export function statusWords(raw: string): string[] {return words.length > 0 ? words : ["Working…"];}-/** The turning asterisk: one small SVG, animated by CSS (index.css). */-function PulseGlyph() {+/**+ * What the turn produced, in tokens.+ *+ * The OUTPUT side only, everywhere it appears — live and on the receipt.+ * The arrow is the CLI's own shorthand, so the two read the same.+ */+function OutTokens({ n }: { n: number }) {+ const t = useT();return (- <svg- viewBox="0 0 12 12"- className="agent-glyph h-3.5 w-3.5 shrink-0 text-primary"- aria-hidden- data-testid="agent-glyph"- >- <g stroke="currentColor" strokeWidth="1.6" strokeLinecap="round">- <line x1="6" y1="1.2" x2="6" y2="10.8" />- <line x1="1.85" y1="3.6" x2="10.15" y2="8.4" />- <line x1="1.85" y1="8.4" x2="10.15" y2="3.6" />- </g>- </svg>+ <span className="inline-flex items-center gap-1" title={t("agent_chat.tokens_out")}>+ <ArrowDown className="h-3 w-3" aria-hidden />+ {formatTokens(n)}+ <span>{t("agent_chat.tokens")}</span>+ </span>);}-/** What the finished turn cost: time, tokens, money — the receipt. */-function TurnFooter({ turn }: { turn: TurnItem }) {+/**+ * The closing line: the turn is over, and this is how it ended.+ *+ * It is drawn for EVERY finished turn, even one that produced nothing at+ * all — the whole point is that the person never has to guess whether the+ * agent is still working (maintainer, 2026-08-25). A turn that ends on a+ * failed tool call with no answer says exactly that instead of trailing+ * off into white space.+ */+function TurnOutcome({ turn }: { turn: TurnItem }) {const t = useT();const usage = turn.usage ?? turn.liveUsage;- const inp = inputTokens(usage);const out = outputTokens(usage);- const hasTokens = (inp ?? 0) > 0 || (out ?? 0) > 0;- if (!turn.durationMs && !hasTokens && !turn.costUsd) return null;+ const answered = turn.blocks.some((b) => b.kind === "text" && b.text.trim().length > 0);++ const { Icon, label, tone } =+ turn.status === "error"+ ? { Icon: CircleAlert, label: t("agent_chat.turn_failed"), tone: "text-destructive/80" }+ : turn.status === "cancelled"+ ? { Icon: Ban, label: t("agent_chat.turn_cancelled"), tone: "text-muted-foreground" }+ : answered+ ? { Icon: Check, label: t("agent_chat.turn_done"), tone: "text-muted-foreground/70" }+ : {+ Icon: CircleAlert,+ label: t("agent_chat.turn_no_answer"),+ tone: "text-muted-foreground",+ };return (<div- className="flex flex-wrap items-center gap-x-2.5 gap-y-0.5 pt-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/70"+ className={cn(+ "flex flex-wrap items-center gap-x-2.5 gap-y-0.5 pt-0.5 font-mono text-[10px] tabular-nums",+ tone,+ )}data-testid="agent-turn-footer"+ data-outcome={turn.status === "done" && !answered ? "no-answer" : turn.status}>- {turn.durationMs ? (- <span className="inline-flex items-center gap-1">- <Clock className="h-3 w-3" aria-hidden />- {formatThoughtDuration(turn.durationMs)}- </span>- ) : null}- {hasTokens && (- <span className="inline-flex items-center gap-1" title={t("agent_chat.tokens")}>- <ArrowUp className="h-3 w-3" aria-hidden />- {formatTokens(inp ?? 0)}- <ArrowDown className="ml-1 h-3 w-3" aria-hidden />- {formatTokens(out ?? 0)}- <span className="ml-0.5">{t("agent_chat.tokens")}</span>- </span>- )}+ <span className="inline-flex items-center gap-1 font-sans text-[11px] font-medium normal-case">+ <Icon className="h-3.5 w-3.5" aria-hidden />+ {label}+ </span>+ {turn.durationMs ? <span>{formatThoughtDuration(turn.durationMs)}</span> : null}+ {out !== null && out > 0 && <OutTokens n={out} />}{turn.costUsd !== null && turn.costUsd > 0 && <span>${turn.costUsd.toFixed(4)}</span>}</div>);@@ -310,58 +413,64 @@ function Prose({ block }: { block: TextBlock }) {}/**- * What the model thought.+ * Everything the turn thought, in one collapsed row.+ *+ * Always a FINISHED thought — `foldThinking` keeps the running one off the+ * screen so this row never competes with the live line. "Thought for 8s"+ * opens to the text when there IS text; when the vendor redacted it (Claude+ * Code does) the row still states the time, because the time is the fact,+ * and stays shut rather than opening onto emptiness.*- * Live: a shimmering "Thinking…" with the seconds ticking — shown even when- * the vendor never streams the thought itself (Claude Code redacts it), so- * eight silent seconds are visibly eight seconds of thinking. Finished:- * "Thought for 8s", opening to the text when there IS text; when there is- * none the row says so instead of opening onto emptiness.+ * The thought reads as prose, not as a log dump: models write their+ * reasoning in Markdown, and a raw `**like this**` on screen is the same+ * defect the local-models panel was fixed for.*/function Reasoning({ block }: { block: ReasoningBlock }) {const t = useT();const [open, setOpen] = useState(false);- const elapsed = useElapsedMs(block.live ? block.startedMs : null);const hasText = Boolean(block.text.trim());- const duration = block.live ? elapsed : (block.durationMs ?? 0);- const header = block.live- ? duration > 900- ? fill(t("agent_chat.thinking_for"), { duration: formatThoughtDuration(duration) })- : t("agent_chat.thinking")- : duration > 0+ const duration = block.durationMs ?? 0;+ const header =+ duration > 0? fill(t("agent_chat.thought_for"), { duration: formatThoughtDuration(duration) }): t("agent_chat.thought");return (- <div data-testid="agent-reasoning" data-live={block.live || undefined}>+ <div data-testid="agent-reasoning"><buttontype="button"onClick={() => setOpen((v) => !v)}aria-expanded={open}disabled={!hasText}className={cn(- "inline-flex items-center gap-1.5 rounded-md py-0.5 pr-2 text-xs text-muted-foreground transition-colors",- hasText ? "hover:text-foreground" : "cursor-default",+ "-ml-1 inline-flex items-center gap-1.5 rounded-md px-1 py-0.5 text-xs text-muted-foreground transition-colors",+ hasText ? "hover:bg-secondary/50 hover:text-foreground" : "cursor-default",)}>- {block.live ? (- <PulseGlyph />- ) : (- <ChevronRight- className={cn(- "h-3.5 w-3.5 shrink-0 transition-transform",- open && "rotate-90",- !hasText && "opacity-30",- )}- aria-hidden- />- )}- <span className={cn(block.live && "thinking-shimmer font-medium")}>{header}</span>+ <ChevronRight+ className={cn(+ "h-3.5 w-3.5 shrink-0 transition-transform",+ open && "rotate-90",+ !hasText && "opacity-30",+ )}+ aria-hidden+ />+ <span>{header}</span></button>{open && hasText && (- <div className="ml-2 mt-1 whitespace-pre-wrap border-l border-border pl-3 text-xs italic leading-relaxed text-muted-foreground">- {block.text}- </div>+ <Trace>+ <div+ className={cn(+ "prose prose-neutral max-w-none text-xs leading-relaxed text-muted-foreground dark:prose-invert [overflow-wrap:anywhere]",+ "prose-p:my-1.5 prose-headings:my-1.5 prose-headings:text-xs prose-headings:font-semibold",+ "prose-strong:text-foreground/80 prose-li:my-0.5 prose-ul:my-1.5 prose-ol:my-1.5",+ "prose-code:font-mono prose-code:text-[0.9em] prose-code:before:hidden prose-code:after:hidden",+ "prose-pre:my-1.5 prose-pre:bg-transparent prose-pre:p-0 prose-pre:text-[11px]",+ )}+ >+ <ReactMarkdown remarkPlugins={[remarkGfm]}>{block.text}</ReactMarkdown>+ </div>+ </Trace>)}</div>);@@ -377,13 +486,47 @@ function pretty(value: unknown): string {}/**- * One tool call.+ * Is the raw input worth printing under a row that already shows it?+ *+ * A shell call whose whole payload is `{"command": "ls -la"}` is fully told+ * by the row's own summary; repeating it as JSON below is the same string+ * twice, which is what made an opened tool call read as duplicated output+ * (maintainer, 2026-08-25). Anything with a second field, or a value the+ * summary had to truncate, still earns its lines.+ */+export function inputAddsNothing(input: unknown, summary: string): boolean {+ if (input === undefined || input === null) return true;+ if (!summary) return false;+ if (typeof input === "string") return input.trim() === summary.trim();+ if (typeof input !== "object" || Array.isArray(input)) return false;+ const entries = Object.entries(input as Record<string, unknown>).filter(+ ([, v]) => v !== undefined && v !== null && v !== "",+ );+ if (entries.length !== 1) return false;+ const [, only] = entries[0];+ return typeof only === "string" && only.trim() === summary.trim();+}++/** The first line of a tool error, short enough to sit on the row. */+function errorGist(text: string): string {+ const line = text.split("\n").find((l) => l.trim()) ?? "";+ const trimmed = line.trim();+ return trimmed.length > 160 ? `${trimmed.slice(0, 159)}…` : trimmed;+}++/**+ * One tool call — a ROW, not a card.** The name is the agent's own — "PowerShell", "ToolSearch", "Grep" — never a* prettied-up rename, because the row is read next to the agent's log* (maintainer, 2026-08-23). The mark left of it comes from the tool family,- * or the vendor's SVG for an MCP server. Click to read what went in and- * what came back.+ * or the vendor's SVG for an MCP server. On the right sits the one thing+ * the person is actually asking of a running agent: whether this step is+ * still going. A finished call shows what it took; a running one counts up.+ *+ * A call that failed says why on the row itself, in one line — the point of+ * a failure is that you read it without hunting for it. Click to see the+ * whole of it, and the input when the summary did not already carry it.*/function ToolRow({block,@@ -399,9 +542,12 @@ function ToolRow({const denied = block.approval?.decision === "deny" || block.approval?.decision === "cancel";const running = block.output === null && !pending && !denied;const done = block.output !== null;+ const elapsed = useElapsedMs(running ? block.startedMs : null);const view = agentToolView(block.name, block.input);const summary = view.summary;const showLogo = Boolean(view.logoUrl) && !logoFailed;+ const gist = block.isError && block.output ? errorGist(block.output) : "";+ const showInput = !inputAddsNothing(block.input, summary);return (<div@@ -409,31 +555,34 @@ function ToolRow({data-tool={block.name}data-family={view.family}data-state={- pending ? "pending" : denied ? "denied" : done ? (block.isError ? "error" : "done") : "running"+ pending+ ? "pending"+ : denied+ ? "denied"+ : done+ ? block.isError+ ? "error"+ : "done"+ : "running"}className={cn(- "overflow-hidden rounded-lg border text-xs transition-colors",- pending- ? "border-primary/40 bg-primary/5"- : block.isError- ? "border-destructive/30 bg-destructive/5"- : running- ? "border-primary/25 bg-secondary/40"- : "border-border/60 bg-secondary/25 hover:border-border",+ "text-xs",+ // Only a call that WANTS something gets a frame of its own: an+ // approval is a question to the person, not a log line.+ pending && "rounded-lg border border-primary/40 bg-primary/5",)}><buttontype="button"onClick={() => setOpen((v) => !v)}aria-expanded={open}- className="flex w-full min-w-0 items-center gap-2 px-2.5 py-1.5 text-left"+ className={cn(+ "-ml-1 flex w-full min-w-0 items-center gap-2 rounded-md px-1 py-1 text-left transition-colors",+ pending ? "ml-0 px-2 pt-1.5" : "hover:bg-secondary/50",+ )}>- <span className="grid h-5 w-5 shrink-0 place-items-center">- {running ? (- <Spinner />- ) : block.isError ? (- <CircleAlert className="h-3.5 w-3.5 text-destructive" aria-hidden />- ) : pending ? (+ <span className="grid h-4 w-4 shrink-0 place-items-center">+ {pending ? (<ShieldQuestion className="h-3.5 w-3.5 text-primary" aria-hidden />) : showLogo ? (<img@@ -444,7 +593,13 @@ function ToolRow({onError={() => setLogoFailed(true)}/>) : (- <view.Icon className="h-3.5 w-3.5 text-muted-foreground" aria-hidden />+ <view.Icon+ className={cn(+ "h-3.5 w-3.5",+ block.isError ? "text-destructive/80" : "text-muted-foreground",+ )}+ aria-hidden+ />)}</span><span@@ -456,31 +611,42 @@ function ToolRow({{view.label}</span>{summary ? (- <span className="min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground">+ <span className="min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground/80">{summary}</span>) : (<span className="flex-1" />)}- {block.durationMs !== null && block.durationMs > 0 && (- <span className="shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70">+ {running ? (+ <span className="inline-flex shrink-0 items-center gap-1.5 text-[10px] text-primary/90">+ <Spinner />+ <span className="font-mono tabular-nums">{formatStepDuration(elapsed)}</span>+ </span>+ ) : block.durationMs !== null && block.durationMs > 0 ? (+ <span className="shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/60">{formatStepDuration(block.durationMs)}</span>- )}+ ) : null}<ChevronRightclassName={cn(- "h-3.5 w-3.5 shrink-0 text-muted-foreground/70 transition-transform",+ "h-3.5 w-3.5 shrink-0 text-muted-foreground/50 transition-transform",open && "rotate-90",)}aria-hidden/></button>- {pending && block.approval && (+ {gist && !open && (<div- className="flex flex-col gap-2 border-t border-primary/20 px-2.5 py-2"- data-testid="agent-approval"+ className="ml-[1.375rem] truncate font-mono text-[11px] text-destructive/80"+ data-testid="agent-tool-gist">+ {gist}+ </div>+ )}++ {pending && block.approval && (+ <div className="flex flex-col gap-2 px-2 pb-2" data-testid="agent-approval"><div className="text-foreground"><span className="font-medium">{t("agent_chat.approval_title")}</span>{" "}<span className="text-muted-foreground">{block.approval.summary || summary}</span>@@ -517,10 +683,8 @@ function ToolRow({)}{open && (- <div className="flex flex-col gap-2 border-t border-border/60 px-2.5 py-2">- {block.input !== undefined && block.input !== null && (- <Detail label={t("agent_chat.tool_input")} text={pretty(block.input)} />- )}+ <Trace tone={block.isError ? "error" : "plain"}>+ {showInput && <Detail label={t("agent_chat.tool_input")} text={pretty(block.input)} />}{denied && <div className="text-muted-foreground">{t("agent_chat.approval_denied")}</div>}{block.output !== null ? (<Detail@@ -531,22 +695,48 @@ function ToolRow({) : (running && <div className="text-muted-foreground">{t("agent_chat.tool_running")}</div>)}- </div>+ </Trace>+ )}+ </div>+ );+}++/**+ * The one shape an opened detail wears: an indent and a hairline.+ *+ * Every unfolded thing in the column — a thought, a tool's input, its+ * output — is drawn this way, so the turn reads as one document with+ * margins rather than a stack of framed cards.+ */+function Trace({+ children,+ tone = "plain",+}: {+ children: ReactNode;+ tone?: "plain" | "error";+}) {+ return (+ <div+ className={cn(+ "ml-[0.375rem] mt-1 flex flex-col gap-2 border-l pl-3",+ tone === "error" ? "border-destructive/40" : "border-border",)}+ >+ {children}</div>);}function Detail({ label, text, error }: { label: string; text: string; error?: boolean }) {return (- <div className="flex flex-col gap-1">- <span className="font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground/70">+ <div className="flex flex-col gap-0.5">+ <span className="font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground/60">{label}</span><preclassName={cn(- "scrollbar-jarvis max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border/60 bg-background/60 p-2 font-mono text-[11.5px] leading-relaxed",- error ? "text-destructive" : "text-foreground",+ "scrollbar-jarvis max-h-72 overflow-auto whitespace-pre-wrap break-words font-mono text-[11.5px] leading-relaxed",+ error ? "text-destructive/90" : "text-muted-foreground",)}>{text}@@ -565,7 +755,7 @@ function Spinner() {<spanaria-hiddendata-testid="agent-spinner"- className="inline-block h-3.5 w-3.5 rounded-full border-2 border-primary/25 border-t-primary motion-safe:animate-spin"+ className="inline-block h-3 w-3 rounded-full border-2 border-primary/25 border-t-primary motion-safe:animate-spin"/>);}diff --git a/jarvis/ui/web/frontend/src/components/agentchat/toolView.test.ts b/jarvis/ui/web/frontend/src/components/agentchat/toolView.test.tsindex 012edea087..25e5313f47 100644--- a/jarvis/ui/web/frontend/src/components/agentchat/toolView.test.ts+++ b/jarvis/ui/web/frontend/src/components/agentchat/toolView.test.ts@@ -4,7 +4,6 @@ import {agentToolView,formatTokens,inputSummary,- inputTokens,outputTokens,} from "@/components/agentchat/toolView";@@ -76,23 +75,7 @@ describe("token formatting", () => {it("reads either usage shape", () => {expect(outputTokens({ output_tokens: 5 })).toBe(5);expect(outputTokens({ output: 7 })).toBe(7);- expect(inputTokens({ prompt_tokens: 9 })).toBe(9);expect(outputTokens(null)).toBeNull();expect(outputTokens({})).toBeNull();});-- it("counts the cache into the input side, and never twice", () => {- // Anthropic keeps the cached part beside input_tokens; both are paid for.- expect(- inputTokens({- input_tokens: 2,- cache_creation_input_tokens: 30420,- cache_read_input_tokens: 21355,- }),- ).toBe(51777);- // The OpenAI shape counts cached tokens INSIDE prompt_tokens already.- expect(inputTokens({ prompt_tokens: 900, cached_input_tokens: 800 })).toBe(900);- expect(inputTokens({ cache_read_input_tokens: 40 })).toBe(40);- expect(inputTokens({})).toBeNull();- });});diff --git a/jarvis/ui/web/frontend/src/components/agentchat/toolView.ts b/jarvis/ui/web/frontend/src/components/agentchat/toolView.tsindex cde5940da6..5b7c6d97c0 100644--- a/jarvis/ui/web/frontend/src/components/agentchat/toolView.ts+++ b/jarvis/ui/web/frontend/src/components/agentchat/toolView.ts@@ -193,31 +193,17 @@ function trimZero(s: string): string {return s.endsWith(".0") ? s.slice(0, -2) : s;}-/** Output tokens so far, from whichever usage shape the runner reported. */-export function outputTokens(usage: Record<string, unknown> | null | undefined): number | null {- if (!usage) return null;- const v = usage.output_tokens ?? usage.output ?? usage.completion_tokens;- return typeof v === "number" && Number.isFinite(v) ? v : null;-}--function finite(v: unknown): number | null {- return typeof v === "number" && Number.isFinite(v) ? v : null;-}-/**- * Everything the turn put IN, cache included.+ * Output tokens so far, from whichever usage shape the runner reported.*- * Anthropic reports the cached part separately from ``input_tokens`` and the- * two never overlap, so a warm session that read 21k cached tokens and paid- * for 2 new ones must read as 21k — not as 2 (BUG-173). The OpenAI shape- * (``cached_input_tokens``) is a SUBSET of ``prompt_tokens`` and is therefore- * deliberately not added here.+ * The only token figure the chat column shows (maintainer, 2026-08-25). The+ * input side of a coding CLI re-counts the whole conversation on every step,+ * so it grows into a number that says nothing about the question that was+ * asked — "283.2k" for one line of chat (BUG-173). What the turn produced is+ * a real, monotonic count, honest live and honest on the receipt.*/-export function inputTokens(usage: Record<string, unknown> | null | undefined): number | null {+export function outputTokens(usage: Record<string, unknown> | null | undefined): number | null {if (!usage) return null;- const base = finite(usage.input_tokens ?? usage.input ?? usage.prompt_tokens);- const cached = finite(usage.cache_read_input_tokens);- const created = finite(usage.cache_creation_input_tokens);- if (base === null && cached === null && created === null) return null;- return (base ?? 0) + (cached ?? 0) + (created ?? 0);+ const v = usage.output_tokens ?? usage.output ?? usage.completion_tokens;+ return typeof v === "number" && Number.isFinite(v) ? v : null;}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 72ed7bc30d..903029ffe9 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -610,11 +610,16 @@"build_hint": "Bau-Modus — der Agent darf Dateien ändern. Klick für Plan-Modus.","plan_hint": "Plan-Modus — der Agent liest und plant, ändert nichts. Klick für Bau-Modus.","folder": "Arbeitsordner",- "folder_hint": "{name} arbeitet für diesen Chat in diesem Ordner","attach_drop_hint": "Dateien hier ablegen, um sie anzuhängen","attach_remove": "{name} entfernen","attach_working": "Wird angehängt…","attach_failed": "Diese Datei konnte nicht angehängt werden.",+ "attach": "Dateien anhängen",+ "attach_hint": "Dateien anhängen — du kannst sie auch hier ablegen oder einfügen",+ "attach_described": "beschrieben",+ "attach_text_read": "Text gelesen",+ "attach_not_described": "nicht beschrieben",+ "attach_nothing": "Darin war nichts, was dieser Chat verwenden kann.","send": "Senden","stop": "Durchgang stoppen","hint_connect": "{provider} ist noch nicht verbunden.",@@ -627,7 +632,10 @@"thinking": "Denkt nach …","thought": "Nachgedacht","thought_for": "{duration} nachgedacht",- "turn_cancelled": "Gestoppt.",+ "turn_cancelled": "Gestoppt",+ "turn_done": "Fertig",+ "turn_failed": "Fehlgeschlagen",+ "turn_no_answer": "Beendet ohne Antwort","approval_title": "Erlauben?","approval_allow": "Erlauben","approval_always": "Immer erlauben",@@ -638,6 +646,7 @@"tool_error": "Fehler","thinking_for": "Denkt seit {duration}","tokens": "Tokens",+ "tokens_out": "Ausgabe-Tokens","tool_running": "Läuft noch…","interrupt_hint": "Esc zum Abbrechen","status_words": "Denkt nach…, Arbeitet…, Gräbt…, Überlegt…, Grübelt…, Sortiert…, Knobelt…, Tüftelt…, Baut zusammen…, Entwirrt…, Kocht…, Werkelt…"@@ -764,7 +773,6 @@},"insight_loading": "Der Verlauf des Laufs wird gelesen…","insight_load_error": "Der Verlauf des Laufs konnte nicht geladen werden: {detail}",- "action_open_output": "Ergebnis öffnen","action_map": "Missionskarte","no_output_dir": "Ausgabeordner liegt nicht mehr auf der Platte","stat_cost_label": "Kosten",@@ -823,7 +831,6 @@"transcript_no_dir": "Das vollständige Worker-Transkript ist mit dem Ausgabeordner verschwunden — die Schritte oben decken weiterhin jedes Ereignis des Laufs ab.","transcript_truncated": "Das Transkript war länger als hier gezeigt.","transcript_dropped": "{n} weitere Schritte werden nicht gezeigt.",- "final_answer": "Abschließende Antwort","step_status": {"pending": "Ausstehend","running": "Läuft",@@ -849,9 +856,6 @@"details_title": "Details","live_title": "Gerade jetzt","live_subtitle": "Tool-Aufrufe, die der Agent in diesem Moment ausführt.",- "timeline_title": "Schritt für Schritt",- "timeline_subtitle": "Was {agent} gesagt und getan hat, der Reihe nach.",- "output_title": "Was herausgekommen ist","actions_one": "1 Aktion ausgeführt","actions_many": "{n} Aktionen in {span} ausgeführt","transcript_fold": "Vollständiges Worker-Transkript · {n} Schritte",@@ -894,6 +898,39 @@"failed_worker_error": "Der Worker-Prozess ist abgestürzt. Es wurde nichts geliefert.","failed_after_review": "Der Worker hat einen Entwurf abgeliefert, aber der Prüfer hat ihn nicht abgenommen — dort endete der Lauf.","failed_generic": "Die Aufgabe des Workers ist nach {runtime} fehlgeschlagen. Es wurde nichts geliefert."+ },+ "action_open_artifacts": "In Artefakten öffnen",+ "register_verdict": "Was passiert ist",+ "register_report": "Bericht von {agent}",+ "register_timeline": "Zeitverlauf",+ "register_files": "Dateien",+ "timeline_meta": "{n} aufgezeichnete Ereignisse",+ "files_meta": "{n} Dateien · +{add} −{del} Zeilen",+ "fact_files": "Dateien",+ "confidence": "{pct} % Sicherheit",+ "report_expand": "Ganzen Bericht lesen",+ "report_collapse": "Bericht einklappen",+ "kind": {+ "start": "Start",+ "plan": "Plan",+ "worker": "Worker",+ "said": "Sagte",+ "ran": "Lief",+ "draft": "Entwurf",+ "review": "Prüfung",+ "fix": "Korrektur",+ "stop": "Stopp",+ "end": "Ende",+ "budget": "Budget",+ "thought": "Gedanke"+ },+ "change": {+ "added": "Neue Datei",+ "modified": "Geändert",+ "deleted": "Gelöscht",+ "renamed": "Umbenannt",+ "delivered": "Geliefert",+ "binary": "binär"}},"tasks_view": {@@ -5007,7 +5044,7 @@},"visualization": {"title": "Artefakte",- "subtitle": "Alles, was deine Durchläufe erzeugt haben — Seiten und Bilder in voller Größe, jeder andere Durchlauf mit Dateien, Status und Steuerung; Quelltext und Durchlauf einen Tab entfernt",+ "subtitle": "Alles, was deine Durchläufe erzeugt haben, jedes als Seite — Artefakte in voller Größe, jeder andere Output genauso aufbereitet; Quelltext, Dateien und Durchlauf einen Tab entfernt","refresh": "Aktualisieren","rail": "Artefakte & Durchläufe","building": "Wird gebaut …",@@ -5018,6 +5055,23 @@"tab_code": "Code","tab_files": "Dateien","tab_run": "Durchlauf",+ "rail_filter": "Anzeigen",+ "filter_all": "Alle",+ "filter_artifacts": "Artefakte",+ "filter_outputs": "Outputs",+ "output_kind": "Output",+ "preview_answer": "Antwort",+ "preview_deliverables": "Dateien",+ "preview_nothing": "Dieser Durchlauf hat weder eine Antwort noch Dateien hinterlassen.",+ "preview_open_in_files": "Unter Dateien öffnen",+ "preview_open_in_files_hint": "Diese Datei wird nicht auf der Seite gezeichnet — öffne sie unter Dateien.",+ "preview_too_large": "Zu groß für die Seite — öffne sie unter Dateien.",+ "preview_more_files": "{0} weitere Dateien unter Dateien.",+ "status_word_success": "Erfolgreich",+ "status_word_error": "Fehlgeschlagen",+ "status_word_running": "Läuft",+ "status_word_cancelled": "Abgebrochen",+ "status_word_unknown": "Unbekannt","stage_tabs": "Ansicht dieses Artefakts","open_external_hint": "Öffnet dieses Artefakt im Browser — ganzes Fenster, teilbar, druckbar.","page_sandbox_note": "Läuft in einer Sandbox: die Skripte der Seite funktionieren, das Netzwerk ist aus.",@@ -5390,6 +5444,9 @@"col_share": "Anteil","col_cost": "Kosten","col_calls": "Aufrufe",+ "billing_label": "Welche Ausgaben zeigen",+ "top_refs_subtitle_counted": "Die {shown} teuersten von {total} Gesprächen, Chats und Missionen — {share} der Gesamtsumme. Zum Filtern anklicken.",+ "billing": {"all": "Alle", "billed": "Über Keys bezahlt", "subscription": "Über Abos"},"speech_area_note": "Hören und Sprechen werden in Audiosekunden und Zeichen abgerechnet — nie in Tokens. Ein Sprache-zu-Sprache-Modell hat kein eigenes Ohr und keinen eigenen Mund; seine Turns stehen unter {name} → Realtime-Stimme. Eine Zeile mit 0,00 $ ist entweder eine lokale Engine (kostenlos) oder ein Anbieter ohne veröffentlichten Tarif — die Spalte „Tarif“ sagt, was zutrifft.","col_rate": "Tarif","stat_total_hint_seat_only": "API-Gegenwert — vollständig durch Abos gedeckt, nichts über einen Key abgerechnet",@@ -5459,6 +5516,7 @@"rate_default": "Standardkurs","footnote": "Gelesen aus {sources}. {estimated} der Summe wurden hier aus den Preistabellen berechnet, nicht vom Anbieter gemeldet. EUR umgerechnet mit {rate} ({rateSource}).","role": {+ "background": "Hintergrundjob","realtime": "Echtzeit-Stimme","tool": "Tool-Modell","pipeline": "Pipeline-Gehirn",@@ -5468,6 +5526,7 @@"tts": "Text zu Sprache"},"surface": {+ "background": "Im Hintergrund","voice": "Sprache","agent_chat": "Agenten-Chat","mission": "Mission",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 839cc7e980..b721e87fcf 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -610,11 +610,16 @@"build_hint": "Build mode — the agent may change files. Click for Plan mode.","plan_hint": "Plan mode — the agent reads and plans, changes nothing. Click for Build mode.","folder": "Working folder",- "folder_hint": "{name} works in this folder for this chat","attach_drop_hint": "Drop the files here to attach them","attach_remove": "Remove {name}","attach_working": "Attaching…","attach_failed": "That file could not be attached.",+ "attach": "Attach files",+ "attach_hint": "Attach files — you can also drop or paste them here",+ "attach_described": "described",+ "attach_text_read": "text read",+ "attach_not_described": "not described",+ "attach_nothing": "That drop carried nothing this chat could use.","send": "Send","stop": "Stop the turn","hint_connect": "{provider} is not connected yet.",@@ -627,7 +632,10 @@"thinking": "Thinking…","thought": "Thought","thought_for": "Thought for {duration}",- "turn_cancelled": "Stopped.",+ "turn_cancelled": "Stopped",+ "turn_done": "Done",+ "turn_failed": "Failed",+ "turn_no_answer": "Finished without an answer","approval_title": "Allow this?","approval_allow": "Allow","approval_always": "Always allow",@@ -638,6 +646,7 @@"tool_error": "Error","thinking_for": "Thinking for {duration}","tokens": "tokens",+ "tokens_out": "Output tokens","tool_running": "Still running…","interrupt_hint": "esc to interrupt","status_words": "Thinking…, Working…, Digging…, Reasoning…, Pondering…, Wrangling…, Puzzling…, Noodling…, Assembling…, Untangling…, Cooking…, Vibing…"@@ -764,7 +773,6 @@},"insight_loading": "Reading the run's record…","insight_load_error": "The run's record could not be loaded: {detail}",- "action_open_output": "Open output","action_map": "Mission map","no_output_dir": "output directory no longer on disk","stat_cost_label": "Cost",@@ -823,7 +831,6 @@"transcript_no_dir": "The worker's full transcript went with the output folder — the steps above still cover every event of the run.","transcript_truncated": "The transcript was longer than what is shown.","transcript_dropped": "{n} more steps are not shown.",- "final_answer": "Final answer","step_status": {"pending": "Pending","running": "Running",@@ -849,9 +856,6 @@"details_title": "Details","live_title": "Right now","live_subtitle": "Tool calls the agent is running at this moment.",- "timeline_title": "Step by step",- "timeline_subtitle": "What {agent} said and did, in order.",- "output_title": "What came out","actions_one": "Ran 1 action","actions_many": "Ran {n} actions in {span}","transcript_fold": "Full worker transcript · {n} steps",@@ -894,6 +898,39 @@"failed_worker_error": "The worker process crashed. Nothing was delivered.","failed_after_review": "The worker produced a draft, but the reviewer did not approve it and the run ended there.","failed_generic": "The worker's task failed after {runtime}. Nothing was delivered."+ },+ "action_open_artifacts": "Open in Artifacts",+ "register_verdict": "What happened",+ "register_report": "{agent}'s report",+ "register_timeline": "Timeline",+ "register_files": "Files",+ "timeline_meta": "{n} recorded events",+ "files_meta": "{n} files · +{add} −{del} lines",+ "fact_files": "Files",+ "confidence": "{pct}% confidence",+ "report_expand": "Read the full report",+ "report_collapse": "Collapse the report",+ "kind": {+ "start": "Start",+ "plan": "Plan",+ "worker": "Worker",+ "said": "Said",+ "ran": "Ran",+ "draft": "Draft",+ "review": "Review",+ "fix": "Fix",+ "stop": "Stop",+ "end": "End",+ "budget": "Budget",+ "thought": "Thought"+ },+ "change": {+ "added": "New file",+ "modified": "Changed",+ "deleted": "Deleted",+ "renamed": "Renamed",+ "delivered": "Delivered",+ "binary": "binary"}},"tasks_view": {@@ -5007,7 +5044,7 @@},"visualization": {"title": "Artifacts",- "subtitle": "Everything your runs produced — pages and pictures full-size, every other run with its files, status and controls; source and run one tab away",+ "subtitle": "Everything your runs produced, every one as a page — artifacts full-size, every other output composed the same way; source, files and the run one tab away","refresh": "Refresh","rail": "Artifacts & runs","building": "Building…",@@ -5018,6 +5055,23 @@"tab_code": "Code","tab_files": "Files","tab_run": "Run",+ "rail_filter": "Show",+ "filter_all": "All",+ "filter_artifacts": "Artifacts",+ "filter_outputs": "Outputs",+ "output_kind": "Output",+ "preview_answer": "Answer",+ "preview_deliverables": "Files",+ "preview_nothing": "This run left no answer and no files behind.",+ "preview_open_in_files": "Open in Files",+ "preview_open_in_files_hint": "This file is not drawn on the page — open it under Files.",+ "preview_too_large": "Too large to draw on the page — open it under Files.",+ "preview_more_files": "{0} more files under Files.",+ "status_word_success": "Succeeded",+ "status_word_error": "Failed",+ "status_word_running": "Running",+ "status_word_cancelled": "Cancelled",+ "status_word_unknown": "Unknown","stage_tabs": "How to view this artifact","open_external_hint": "Open this artifact in your browser — full window, shareable, printable.","page_sandbox_note": "Runs in a sandbox: the page's own scripts work, the network is off.",@@ -5390,6 +5444,9 @@"col_share": "Share","col_cost": "Cost","col_calls": "Calls",+ "billing_label": "Which spend to show",+ "top_refs_subtitle_counted": "The {shown} most expensive of {total} conversations, chats and missions — {share} of the total. Click one to filter by it.",+ "billing": {"all": "All", "billed": "Billed to keys", "subscription": "On subscriptions"},"speech_area_note": "Hearing and speaking are billed in audio seconds and characters — never tokens. A speech-to-speech model has no separate ear or mouth, so its turns sit under {name} → Realtime voice. A row at $0.00 is either a local engine (free) or a vendor that publishes no rate — the Rate column says which.","col_rate": "Rate","stat_total_hint_seat_only": "API-equivalent — fully covered by subscriptions, nothing billed to a key",@@ -5459,6 +5516,7 @@"rate_default": "default rate","footnote": "Read from {sources}. {estimated} of the total was priced here from the rate tables rather than reported by the provider. EUR converted at {rate} ({rateSource}).","role": {+ "background": "Background job","realtime": "Realtime voice","tool": "Tool model","pipeline": "Pipeline brain",@@ -5468,6 +5526,7 @@"tts": "Text to speech"},"surface": {+ "background": "Behind the scenes","voice": "Voice","agent_chat": "Agent chat","mission": "Mission",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex f7db4a856e..d2e28fded8 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -610,11 +610,16 @@"build_hint": "Modo construir: el agente puede cambiar archivos. Clic para el modo planificar.","plan_hint": "Modo planificar: el agente lee y planifica, no cambia nada. Clic para el modo construir.","folder": "Carpeta de trabajo",- "folder_hint": "{name} trabaja en esta carpeta para este chat","attach_drop_hint": "Suelta aquí los archivos para adjuntarlos","attach_remove": "Quitar {name}","attach_working": "Adjuntando…","attach_failed": "No se pudo adjuntar ese archivo.",+ "attach": "Adjuntar archivos",+ "attach_hint": "Adjuntar archivos — también puedes soltarlos o pegarlos aquí",+ "attach_described": "descrito",+ "attach_text_read": "texto leído",+ "attach_not_described": "sin descripción",+ "attach_nothing": "Lo que soltaste no contenía nada que este chat pueda usar.","send": "Enviar","stop": "Detener el turno","hint_connect": "{provider} aún no está conectado.",@@ -627,7 +632,10 @@"thinking": "Pensando…","thought": "Pensó","thought_for": "Pensó durante {duration}",- "turn_cancelled": "Detenido.",+ "turn_cancelled": "Detenido",+ "turn_done": "Listo",+ "turn_failed": "Falló",+ "turn_no_answer": "Terminó sin respuesta","approval_title": "¿Permitir esto?","approval_allow": "Permitir","approval_always": "Permitir siempre",@@ -638,6 +646,7 @@"tool_error": "Error","thinking_for": "Pensando desde hace {duration}","tokens": "tokens",+ "tokens_out": "Tokens de salida","tool_running": "Sigue en marcha…","interrupt_hint": "esc para interrumpir","status_words": "Pensando…, Trabajando…, Excavando…, Razonando…, Cavilando…, Ordenando…, Descifrando…, Ideando…, Montando…, Desenredando…, Cocinando…, Fluyendo…"@@ -764,7 +773,6 @@},"insight_loading": "Leyendo el registro de la ejecución…","insight_load_error": "No se pudo cargar el registro de la ejecución: {detail}",- "action_open_output": "Abrir resultado","action_map": "Mapa de la misión","no_output_dir": "la carpeta de salida ya no está en el disco","stat_cost_label": "Coste",@@ -823,7 +831,6 @@"transcript_no_dir": "La transcripción completa del worker se fue con la carpeta de salida — los pasos de arriba siguen cubriendo cada evento de la ejecución.","transcript_truncated": "La transcripción era más larga de lo que se muestra.","transcript_dropped": "{n} pasos más no se muestran.",- "final_answer": "Respuesta final","step_status": {"pending": "Pendiente","running": "En marcha",@@ -849,9 +856,6 @@"details_title": "Detalles","live_title": "Ahora mismo","live_subtitle": "Llamadas a herramientas que el agente ejecuta en este momento.",- "timeline_title": "Paso a paso",- "timeline_subtitle": "Lo que {agent} dijo e hizo, en orden.",- "output_title": "Lo que salió","actions_one": "Ejecutó 1 acción","actions_many": "Ejecutó {n} acciones en {span}","transcript_fold": "Transcripción completa del worker · {n} pasos",@@ -894,6 +898,39 @@"failed_worker_error": "El proceso del worker falló. No se entregó nada.","failed_after_review": "El worker produjo un borrador, pero el revisor no lo aprobó y la ejecución terminó ahí.","failed_generic": "La tarea del worker falló tras {runtime}. No se entregó nada."+ },+ "action_open_artifacts": "Abrir en Artefactos",+ "register_verdict": "Qué pasó",+ "register_report": "Informe de {agent}",+ "register_timeline": "Cronología",+ "register_files": "Archivos",+ "timeline_meta": "{n} eventos registrados",+ "files_meta": "{n} archivos · +{add} −{del} líneas",+ "fact_files": "Archivos",+ "confidence": "{pct} % de confianza",+ "report_expand": "Leer el informe completo",+ "report_collapse": "Plegar el informe",+ "kind": {+ "start": "Inicio",+ "plan": "Plan",+ "worker": "Worker",+ "said": "Dijo",+ "ran": "Ejecutó",+ "draft": "Borrador",+ "review": "Revisión",+ "fix": "Corrección",+ "stop": "Parada",+ "end": "Fin",+ "budget": "Presupuesto",+ "thought": "Pensó"+ },+ "change": {+ "added": "Archivo nuevo",+ "modified": "Modificado",+ "deleted": "Eliminado",+ "renamed": "Renombrado",+ "delivered": "Entregado",+ "binary": "binario"}},"tasks_view": {@@ -5007,7 +5044,7 @@},"visualization": {"title": "Artefactos",- "subtitle": "Todo lo que produjeron tus ejecuciones — páginas e imágenes a tamaño completo, cada otra ejecución con sus archivos, estado y controles; código y ejecución a una pestaña de distancia",+ "subtitle": "Todo lo que produjeron tus ejecuciones, cada una como página — artefactos a tamaño completo, cualquier otro resultado compuesto igual; código, archivos y ejecución a una pestaña","refresh": "Actualizar","rail": "Artefactos y ejecuciones","building": "Creando…",@@ -5018,6 +5055,23 @@"tab_code": "Código","tab_files": "Archivos","tab_run": "Ejecución",+ "rail_filter": "Mostrar",+ "filter_all": "Todo",+ "filter_artifacts": "Artefactos",+ "filter_outputs": "Resultados",+ "output_kind": "Resultado",+ "preview_answer": "Respuesta",+ "preview_deliverables": "Archivos",+ "preview_nothing": "Esta ejecución no dejó ni respuesta ni archivos.",+ "preview_open_in_files": "Abrir en Archivos",+ "preview_open_in_files_hint": "Este archivo no se dibuja en la página — ábrelo en Archivos.",+ "preview_too_large": "Demasiado grande para la página — ábrelo en Archivos.",+ "preview_more_files": "{0} archivos más en Archivos.",+ "status_word_success": "Completada",+ "status_word_error": "Fallida",+ "status_word_running": "En curso",+ "status_word_cancelled": "Cancelada",+ "status_word_unknown": "Desconocido","stage_tabs": "Cómo ver este artefacto","open_external_hint": "Abre este artefacto en el navegador — ventana completa, se puede compartir e imprimir.","page_sandbox_note": "Se ejecuta en un entorno aislado: los scripts de la página funcionan, la red está desactivada.",@@ -5390,6 +5444,9 @@"col_share": "Parte","col_cost": "Coste","col_calls": "Llamadas",+ "billing_label": "Qué gasto mostrar",+ "top_refs_subtitle_counted": "Las {shown} más caras de {total} conversaciones, chats y misiones — {share} del total. Haz clic en una para filtrar.",+ "billing": {"all": "Todo", "billed": "Facturado a claves", "subscription": "Con suscripciones"},"speech_area_note": "Escuchar y hablar se facturan en segundos de audio y caracteres — nunca en tokens. Un modelo voz a voz no tiene oído ni boca propios; sus turnos están en {name} → Voz en tiempo real. Una fila a $0,00 es un motor local (gratis) o un proveedor sin tarifa publicada — la columna «Tarifa» lo indica.","col_rate": "Tarifa","stat_total_hint_seat_only": "Equivalente API — cubierto por completo por suscripciones, nada facturado a una clave",@@ -5459,6 +5516,7 @@"rate_default": "tipo por defecto","footnote": "Leído de {sources}. {estimated} del total se calculó aquí con las tablas de tarifas, no lo informó el proveedor. EUR convertido a {rate} ({rateSource}).","role": {+ "background": "Tarea en segundo plano","realtime": "Voz en tiempo real","tool": "Modelo de herramientas","pipeline": "Cerebro de la cadena",@@ -5468,6 +5526,7 @@"tts": "Texto a voz"},"surface": {+ "background": "En segundo plano","voice": "Voz","agent_chat": "Chat de agentes","mission": "Misión",diff --git a/tests/unit/agent_chat/test_agent_chat_core.py b/tests/unit/agent_chat/test_agent_chat_core.pyindex ff5aca12b5..134bd8edb4 100644--- a/tests/unit/agent_chat/test_agent_chat_core.py+++ b/tests/unit/agent_chat/test_agent_chat_core.py@@ -287,6 +287,33 @@ def test_claude_stream_translation_streams_then_finalizes():assert st.cost_usd == 0.01 and st.usage == {"output_tokens": 5} and st.status == "done"+def test_streamed_text_counts_as_an_answer_so_the_result_line_never_repeats_it():+ """A turn cut short must not print its answer a second time.++ The closing ``result`` line carries the whole answer again, and the runner+ falls back to it for a turn that produced no text at all. Streamed deltas+ therefore have to mark the turn as answered: without that, a stream that+ ends before its closing ``assistant`` message — Stop, a crash, a killed+ CLI — replayed the same text under a fresh message id, and the chat showed+ it twice (maintainer, 2026-08-25).+ """+ st = _ClaudeState(turn_id="t")+ lines = [+ {"type": "stream_event", "event": {"type": "message_start", "message": {"id": "m1"}}},+ {+ "type": "stream_event",+ "event": {+ "type": "content_block_delta",+ "index": 0,+ "delta": {"type": "text_delta", "text": "half an answer"},+ },+ },+ ]+ for obj in lines:+ translate_claude_line(obj, st)+ assert st.emitted_text is True++def test_codex_stream_translation_maps_items_to_tools():st = _CodexState(turn_id="t")lines = [