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
feat(ui): show coding threads that a Jarvis agent started
rubenluetke10-beepe5dcac0b6c9d
diff --git a/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx b/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsxindex f387670b2d..bdcc9c0014 100644--- a/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx+++ b/jarvis/ui/web/frontend/src/components/agentchat/AgentTimeline.tsx@@ -2,6 +2,8 @@ import { Fragment, memo, useMemo } from "react";import { ChatMarkdown, MediaPreview, mediaKind } from "@/components/agentchat/ChatMarkdown";import { CircleAlert, FileText, ImageIcon } from "lucide-react";import { InternalMessageBubble, type InternalParticipant } from "./InternalMessageBubble";+import { CodingThreadActivity } from "@/components/agentic/threads/CodingThreadLink";+import { codingThreadOf } from "@/components/agentic/threads/openCodingThread";import { MessageWithChips } from "./ToolChoiceChips";import { ProviderLogo } from "@/components/providers/ProviderLogo";import { effortLabel } from "./AgentComposer";@@ -71,6 +73,10 @@ export function AgentTimeline({);function renderItem(item: TimelineItem) {+ if (item.type === "internal" && codingThreadOf(item.message.sender_id)) {+ return <CodingThreadActivity key={item.id} label={item.message.text}+ threadId={codingThreadOf(item.message.sender_id)} failed={item.message.status === "failed"} />;+ }if (item.type === "internal") {return (<InternalMessageBubble@@ -177,6 +183,11 @@ export function AgentTimeline({}if (item.type === "notice") {if (item.kind === "native_goal_verdict") return <p key={item.id} className="text-xs text-muted-foreground">{t("slash.verifying")}</p>;+ if (item.kind === "coding_thread") {+ const started = t("society.chat.coding_thread_started").replace("{0}", String(item.data.agent ?? ""));+ return <CodingThreadActivity key={item.id} label={`${started} · ${String(item.data.title ?? "")}`}+ threadId={String(item.data.thread_id ?? "")} />;+ }// The society reporting back on a task Jarvis handed out: the// agent's name as the headline, its summary underneath. Muted and// centred like a stamp — it is not Jarvis speaking.diff --git a/jarvis/ui/web/frontend/src/components/agentchat/reduce.ts b/jarvis/ui/web/frontend/src/components/agentchat/reduce.tsindex 200637a7e7..368fc0903c 100644--- a/jarvis/ui/web/frontend/src/components/agentchat/reduce.ts+++ b/jarvis/ui/web/frontend/src/components/agentchat/reduce.ts@@ -187,6 +187,8 @@ export interface UserItem {/** Files that went in with this message; empty on an ordinary one. */attachments: UserAttachment[];toolChoices?: ToolChoice[];+ /** A Jarvis agent wrote this message into a coding thread on the person's behalf. */+ author?: { agentId: string; name: string };tsMs: number;}@@ -293,6 +295,14 @@ export const EMPTY_TIMELINE: Timeline = {};/** The attachment receipts off one `user_message`, tolerant of any shape. */+/** Who wrote a message on the person's behalf (`author` on `user_message`), if anyone. */+function messageAuthor(raw: unknown): { agentId: string; name: string } | undefined {+ if (!raw || typeof raw !== "object") return undefined;+ const row = raw as Record<string, unknown>;+ const name = typeof row.name === "string" ? row.name : "";+ return name ? { agentId: typeof row.agent_id === "string" ? row.agent_id : "", name } : undefined;+}+function userAttachments(raw: unknown): UserAttachment[] {if (!Array.isArray(raw)) return [];const out: UserAttachment[] = [];@@ -653,6 +663,7 @@ export function reduceEvent(tl: Timeline, ev: AgentChatEvent): Timeline {type: "user",id: `u-${seq || ev.ts_ms}`,...(p.origin === "control" ? { origin: "control" as const } : {}),+ ...(messageAuthor(p.author) ? { author: messageAuthor(p.author) } : {}),// `typed` is present only when the message carried files, and it// is the person's own sentence; `text` is the composed prompt.text: str(p.typed) || str(p.text),diff --git a/jarvis/ui/web/frontend/src/components/agentic/threads/CodingThreadLink.tsx b/jarvis/ui/web/frontend/src/components/agentic/threads/CodingThreadLink.tsxnew file mode 100644index 0000000000..56e7e5d88c--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/agentic/threads/CodingThreadLink.tsx@@ -0,0 +1,22 @@+import { ChevronRight, Code2 } from "lucide-react";+import { useT } from "@/i18n";+import { cn } from "@/lib/utils";+import { openCodingThread } from "./openCodingThread";++/**+ * A coding thread this agent started, or news from one: one quiet line that+ * opens the thread in the Agentic IDE, where the whole exchange is visible.+ */+export function CodingThreadActivity({ label, threadId, failed = false }: {+ label: string; threadId: string; failed?: boolean;+}) {+ const t = useT();+ return <button type="button" onClick={() => openCodingThread(threadId)} title={t("society.chat.coding_thread_open")}+ data-testid="coding-thread-activity"+ className={cn("mx-auto my-3 flex max-w-[min(100%,36rem)] items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", failed && "text-destructive")}>+ <Code2 aria-hidden className="h-3.5 w-3.5 shrink-0" />+ <span className="min-w-0 truncate">{label}</span>+ <span className="shrink-0 underline underline-offset-4">{t("society.chat.coding_thread_open")}</span>+ <ChevronRight aria-hidden className="h-3 w-3 shrink-0" />+ </button>;+}diff --git a/jarvis/ui/web/frontend/src/components/agentic/threads/ThreadTimeline.tsx b/jarvis/ui/web/frontend/src/components/agentic/threads/ThreadTimeline.tsxindex 4c65b5ab55..ad27f34762 100644--- a/jarvis/ui/web/frontend/src/components/agentic/threads/ThreadTimeline.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/threads/ThreadTimeline.tsx@@ -1,5 +1,5 @@import { createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from "react";-import { ArrowDown, Brain, Check, ChevronDown, ChevronRight, Copy, Diff, FileText, Hammer, MessageCircleQuestion, ShieldAlert, X } from "lucide-react";+import { ArrowDown, Bot, Brain, Check, ChevronDown, ChevronRight, Copy, Diff, FileText, Hammer, MessageCircleQuestion, ShieldAlert, X } from "lucide-react";import { ChatMarkdown } from "@/components/agentchat/ChatMarkdown";import type { TextBlock, TimelineItem, ToolBlock, TurnBlock, TurnItem, UserItem } from "@/components/agentchat/reduce";import { toolDiff, type DiffFile } from "@/components/agentchat/toolDiff";@@ -379,7 +379,12 @@ function clock(ms: number): string {}function UserBubble({ item }: { item: UserItem }) {+ const t = useT();return <div className="group flex flex-col items-end gap-1" data-testid="thread-user-message">+ {item.author && <div className="flex items-center gap-1.5 pr-1 text-xs text-muted-foreground" data-testid="thread-message-author">+ <Bot aria-hidden className="h-3.5 w-3.5 shrink-0" />+ <span className="truncate">{t("society.chat.coding_thread_author").replace("{0}", item.author.name)}</span>+ </div>}<div className="max-w-[80%] rounded-2xl bg-secondary px-4 py-2.5 text-foreground">{item.attachments.length > 0 && <div className="mb-2 flex flex-wrap justify-end gap-2">{item.attachments.map((file) => file.url && file.kind === "image"diff --git a/jarvis/ui/web/frontend/src/components/agentic/threads/codingThreads.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/threads/codingThreads.test.tsxnew file mode 100644index 0000000000..1493f02ff2--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/agentic/threads/codingThreads.test.tsx@@ -0,0 +1,52 @@+import { cleanup, fireEvent, render, screen } from "@testing-library/react";+import { afterEach, describe, expect, it } from "vitest";+import { EMPTY_TIMELINE, reduceEvents, type InternalMessageItem, type UserItem } from "@/components/agentchat/reduce";+import { AgentMessageActivity, CodingThreadActivity } from "@/components/society/chat/ChatActivity";+import { useEventStore } from "@/store/events";+import { useIdeThreadsStore } from "@/store/ideThreads";+import { codingThreadOf } from "./openCodingThread";+import { ThreadTimeline } from "./ThreadTimeline";++afterEach(cleanup);++describe("threads a Jarvis agent started", () => {+ it("keeps who wrote a message on the person's behalf", () => {+ const [item] = reduceEvents(EMPTY_TIMELINE, [+ { seq: 1, ts_ms: 1, kind: "user_message", payload: { text: "Add a login page", author: { agent_id: "nova", name: "Nova" } } },+ ]).items as UserItem[];+ expect(item.author).toEqual({ agentId: "nova", name: "Nova" });+ const [plain] = reduceEvents(EMPTY_TIMELINE, [+ { seq: 1, ts_ms: 1, kind: "user_message", payload: { text: "typed by the person" } },+ ]).items as UserItem[];+ expect(plain.author).toBeUndefined();+ });++ it("names the agent above its message in the thread", () => {+ const item: UserItem = { type: "user", id: "u1", text: "Add a login page", attachments: [], author: { agentId: "nova", name: "Nova" }, tsMs: 1 };+ render(<ThreadTimeline items={[item]} sessionId="s1" bottomInset={0} />);+ expect(screen.getByTestId("thread-message-author").textContent).toContain("Nova");+ expect(screen.getByText("Add a login page")).toBeTruthy();+ });++ it("opens the thread in the Agentic IDE from the agent's chat", () => {+ render(<CodingThreadActivity label="Started a Claude Code thread · Login page" threadId="thread-1" />);+ fireEvent.click(screen.getByTestId("coding-thread-activity"));+ expect(useIdeThreadsStore.getState().layout).toBe("threads");+ expect(useIdeThreadsStore.getState().selection.sessionId).toBe("thread-1");+ expect(useEventStore.getState().activeSection).toBe("agentic-ide");+ });++ it("shows a thread's report as a link to the thread, not as a teammate message", () => {+ const item: InternalMessageItem = {+ type: "internal", id: "m1", tsMs: 1,+ message: {+ message_id: "m1", sender_id: "coding-thread:thread-2", sender_name: "Anthropic Claude · Login page",+ sender_kind: "agent", text: "Anthropic Claude finished in “Login page”.", prompt: "", trace_id: "t",+ status: "delivered", turn_id: "", error: "",+ },+ };+ render(<AgentMessageActivity item={item} roster={[]} />);+ expect(screen.getByTestId("coding-thread-activity").textContent).toContain("finished");+ expect(codingThreadOf(item.message.sender_id)).toBe("thread-2");+ });+});diff --git a/jarvis/ui/web/frontend/src/components/agentic/threads/openCodingThread.ts b/jarvis/ui/web/frontend/src/components/agentic/threads/openCodingThread.tsnew file mode 100644index 0000000000..f7f2ec3941--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/agentic/threads/openCodingThread.ts@@ -0,0 +1,20 @@+import { useEventStore } from "@/store/events";+import { useIdeThreadsStore } from "@/store/ideThreads";++/**+ * Show one coding thread in the Agentic IDE's thread layout — the jump from+ * an agent's chat to the thread it started. The thread view finds the+ * thread's project itself, so none is passed.+ */+export function openCodingThread(sessionId: string): void {+ if (!sessionId) return;+ const threads = useIdeThreadsStore.getState();+ threads.setLayout("threads");+ threads.openThread(sessionId, "");+ useEventStore.getState().setActiveSection("agentic-ide");+}++/** The thread a coding-thread report came from (`coding-thread:<id>` sender ids). */+export function codingThreadOf(senderId: string): string {+ return senderId.startsWith("coding-thread:") ? senderId.slice("coding-thread:".length) : "";+}diff --git a/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.tsx b/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.tsxindex f8084039f5..b610dbd3ea 100644--- a/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.tsx+++ b/jarvis/ui/web/frontend/src/components/society/chat/AgentChatPanel.tsx@@ -2,6 +2,7 @@ import { PairConversationBoundary } from "@/components/agentchat/PairConversatioimport {AgentMessageActivity,ChatActivity,+ CodingThreadActivity,DelegationActivity,RoutineActivity,assignmentOf,@@ -793,6 +794,10 @@ function NoticeLine({ item }: { item: NoticeItem }) {agentId, sessionId, title: item.text, timestamp: item.tsMs,}) : undefined} />;}+ if (item.kind === "coding_thread") {+ const label = t("society.chat.coding_thread_started").replace("{0}", String(item.data.agent ?? ""));+ return <CodingThreadActivity label={`${label} · ${String(item.data.title ?? "")}`} threadId={String(item.data.thread_id ?? "")} />;+ }if (item.kind === "native_goal_verdict") return <p className="py-1 text-xs text-muted-foreground">{t("slash.verifying")}</p>;const headline =item.kind === "society_result"diff --git a/jarvis/ui/web/frontend/src/components/society/chat/ChatActivity.tsx b/jarvis/ui/web/frontend/src/components/society/chat/ChatActivity.tsxindex 878323fa76..ec91fb3845 100644--- a/jarvis/ui/web/frontend/src/components/society/chat/ChatActivity.tsx+++ b/jarvis/ui/web/frontend/src/components/society/chat/ChatActivity.tsx@@ -1,5 +1,7 @@import { useId, useState, type ReactNode } from "react";import { ArrowDownLeft, ArrowUpRight, ChevronRight, Clock3, Inbox } from "lucide-react";+import { CodingThreadActivity } from "@/components/agentic/threads/CodingThreadLink";+import { codingThreadOf } from "@/components/agentic/threads/openCodingThread";import { ChatMarkdown } from "@/components/agentchat/ChatMarkdown";import { useOpenPairConversation } from "@/components/agentchat/PairConversation";import type { InternalMessageItem } from "@/components/agentchat/reduce";@@ -10,6 +12,7 @@ import { cn } from "@/lib/utils";import { AgentSwatch } from "../AgentSwatch";import type { SocietyAgent } from "../data";export { routineTask } from "./routineExecution";+export { CodingThreadActivity };/** A quiet event in the conversation; details remain keyboard accessible. */export function ChatActivity({ label, icon, children, failed = false }: {@@ -78,6 +81,7 @@ export function RoutineActivity({ task, original, onOpen }: { task: string; origexport function AgentMessageActivity({ item, roster }: { item: InternalMessageItem; roster: SocietyAgent[] }) {const t = useT();+ const codingThread = codingThreadOf(item.message.sender_id);const openPair = useOpenPairConversation();const assistantName = useEventStore((s) => s.assistantName);const outgoing = Boolean(item.outgoing);@@ -88,6 +92,7 @@ export function AgentMessageActivity({ item, roster }: { item: InternalMessageItconst failed = status === "failed";const canOpenPair = Boolean(openPair && id && id !== "user" && item.message.sender_kind !== "user");const label = t(failed ? "society.chat.message_failed" : outgoing ? "society.chat.message_to" : "society.chat.message_from");+ if (codingThread) return <CodingThreadActivity label={item.message.text} threadId={codingThread} failed={failed} />;return <ChatActivity failed={failed} icon={outgoing ? <ArrowUpRight aria-hidden className="h-3.5 w-3.5 shrink-0" /> : <ArrowDownLeft aria-hidden className="h-3.5 w-3.5 shrink-0" />}label={<span className="inline-flex max-w-full items-center gap-2"><span>{label}</span>{participant ? <AgentSwatch agent={participant} size={18} /> : null}<span className="truncate">{name}</span>{status === "queued" ? <span>· {t("agent_chat.delivery_queued")}</span> : null}</span>}><ChatMarkdown text={item.message.text} />diff --git a/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.ts b/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.tsindex e06b145d2d..a975644325 100644--- a/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.ts+++ b/jarvis/ui/web/frontend/src/components/society/chat/mentionItems.ts@@ -445,10 +445,10 @@ export function codingAssignmentHint(items: readonly MentionItem[], folder: strifolder.trim()? `Project directory: ${JSON.stringify(folder.trim())}.`: "Use the project directory specified in the user's message. If it is unclear, ask for it.",- "Use coding-session to discover and open or explicitly target the correct IDE session, then use assign " +- "with a self-contained task and user-grounded done_when criteria to supervise it to completion. " +- "Answer ordinary follow-up questions yourself. These are coding CLIs, not society teammates. " +- "Follow approval rules; accepted is not completed.",+ "Use coding-session open with that agent and folder and a complete brief you write from the user's " ++ "request; you are woken here when the thread finishes, asks or waits. Answer its questions yourself " ++ "when the request settles them, follow up until the task is done, then report the outcome. These are " ++ "coding CLIs, not society teammates. Started is not finished.",].map((line) => `[coding-agent] ${line}`).join("\n");}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 8769d169bc..f8ac02cf58 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -5617,6 +5617,9 @@"identity_undone": "Wieder {0}","assignment_from": "Auftrag von {0}","message_waiting": "Wartet, bis die aktuelle Aufgabe fertig ist",+ "coding_thread_started": "{0}-Thread gestartet",+ "coding_thread_open": "Thread öffnen",+ "coding_thread_author": "Geschrieben von {0}","message_not_sent": "Nicht gesendet: {0}","context_rollover": "Frischer Arbeitskontext – Gedächtnis und letzte Nachrichten übernommen","allow_always": "Immer erlauben",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 3e20f51bd9..9c74b653d7 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -5617,6 +5617,9 @@"identity_undone": "Back to {0}","assignment_from": "Task from {0}","message_waiting": "Waits until the current task is done",+ "coding_thread_started": "Started a {0} thread",+ "coding_thread_open": "Open thread",+ "coding_thread_author": "Written by {0}","message_not_sent": "Not sent: {0}","context_rollover": "Fresh working context — memory and recent messages carried over","allow_always": "Always allow",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex aeaec37801..61d69f42a6 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -5617,6 +5617,9 @@"identity_undone": "De nuevo {0}","assignment_from": "Encargo de {0}","message_waiting": "Espera a que termine la tarea actual",+ "coding_thread_started": "Hilo de {0} iniciado",+ "coding_thread_open": "Abrir hilo",+ "coding_thread_author": "Escrito por {0}","message_not_sent": "No enviado: {0}","context_rollover": "Contexto de trabajo nuevo: se conservan la memoria y los mensajes recientes","allow_always": "Permitir siempre",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/zh.json b/jarvis/ui/web/frontend/src/i18n/locales/zh.jsonindex 277ef38cb2..cf71a7da73 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/zh.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/zh.json@@ -5615,6 +5615,9 @@"identity_undone": "已恢复为 {0}","assignment_from": "来自 {0} 的任务","message_waiting": "等当前任务完成后发送",+ "coding_thread_started": "已启动 {0} 线程",+ "coding_thread_open": "打开线程",+ "coding_thread_author": "由 {0} 撰写","message_not_sent": "未发送:{0}","context_rollover": "已换用新的工作上下文——记忆和最近的消息已带过来","allow_always": "始终允许",