Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-6264: feat(chat): show agent names in session list (#7087)
iiwish5e99a0597eda
diff --git a/packages/views/chat/components/chat-thread-list.test.tsx b/packages/views/chat/components/chat-thread-list.test.tsxindex 53a36343ba..a8338b7ca5 100644--- a/packages/views/chat/components/chat-thread-list.test.tsx+++ b/packages/views/chat/components/chat-thread-list.test.tsx@@ -89,13 +89,18 @@ const sessions: ChatSession[] = [function renderList(activeSessionId: string | null,- { onArchive = vi.fn(), onSelectSession = vi.fn() } = {},+ {+ onArchive = vi.fn(),+ onSelectSession = vi.fn(),+ renderedSessions = sessions,+ renderedAgents = [agent],+ } = {},) {render(<I18nProvider locale="en" resources={TEST_RESOURCES}><ChatThreadList- sessions={sessions}- agents={[agent]}+ sessions={renderedSessions}+ agents={renderedAgents}activeSessionId={activeSessionId}onSelectSession={onSelectSession}onArchive={onArchive}@@ -174,6 +179,48 @@ describe("ChatThreadList no_response preview (MUL-4351)", () => {});});+describe("ChatThreadList agent identity", () => {+ it("shows and bounds the resolved agent name without replacing the preview", () => {+ const longName = "A very long agent name that must not take over the conversation row";+ const longNameAgent = { id: "agent-1", name: longName } as unknown as Agent;+ const session = makeSession({+ id: "agent-name",+ last_message: {+ content: "Latest project update",+ role: "assistant",+ created_at: "2026-07-08T03:00:00Z",+ },+ });++ renderList(null, {+ renderedSessions: [session],+ renderedAgents: [longNameAgent],+ });++ const name = screen.getByText(longName);+ expect(name.className).toContain("max-w-[40%]");+ expect(name.className).toContain("truncate");+ expect(screen.getByText("Latest project update")).toBeInTheDocument();+ });++ it("keeps the existing preview when the session agent is unavailable", () => {+ const session = makeSession({+ id: "missing-agent",+ agent_id: "missing-agent-id",+ last_message: {+ content: "Still identifiable by its preview",+ role: "assistant",+ created_at: "2026-07-08T03:00:00Z",+ },+ });++ renderList(null, { renderedSessions: [session] });++ expect(screen.queryByText("Alpha")).not.toBeInTheDocument();+ expect(screen.getByText("Still identifiable by its preview")).toBeInTheDocument();+ });+});+// Touch has no hover, so the hover strip's actions also live in a per-row menu.describe("ChatThreadList compact row menu", () => {beforeEach(() => {diff --git a/packages/views/chat/components/chat-thread-list.tsx b/packages/views/chat/components/chat-thread-list.tsxindex e9b3b45311..e35b458ef9 100644--- a/packages/views/chat/components/chat-thread-list.tsx+++ b/packages/views/chat/components/chat-thread-list.tsx@@ -63,11 +63,12 @@ function toPreview(content: string): string {}/**- * IM-style conversation list: each row is agent avatar + name + last-message- * preview + time, with a red unread *count* badge. An in-flight agent shows a- * "typing…" indicator; a failed last reply shows a destructive hint. Rows are- * rendered in the server's order (most-recent activity first). Renaming lives- * in the conversation header's ⋯ menu, not here.+ * IM-style conversation list: each row is agent avatar + session title + agent+ * name + last-message preview + time, with a red unread *count* badge. An+ * in-flight agent shows a "typing…" indicator; a failed last reply shows a+ * destructive hint. Rows are rendered in the server's order (most-recent+ * activity first). Renaming lives in the conversation header's ⋯ menu, not+ * here.** Two views, toggled locally: the default "history" view lists active chats and* hovering a row reveals pin + archive (or stop, while running) — archiving is@@ -204,6 +205,7 @@ export function ChatThreadList({const renderRow = (session: ChatSession) => {const isCurrent = session.id === activeSessionId;const agent = agentById.get(session.agent_id) ?? null;+ const agentName = agent?.name.trim() || null;const pendingTask = pendingTaskBySessionId.get(session.id);const isRunning = !!pendingTask;// Only "offline" (definitively long-offline) downgrades typing → waiting.@@ -413,7 +415,19 @@ export function ChatThreadList({/>) : (<>- <div className="min-w-0 flex-1 overflow-hidden text-caption">{previewNode}</div>+ <div className="flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden text-caption">+ {agentName && (+ <>+ <span className="max-w-[40%] shrink-0 truncate font-medium text-muted-foreground">+ {agentName}+ </span>+ <span aria-hidden="true" className="shrink-0 text-faint-foreground">+ ·+ </span>+ </>+ )}+ <div className="min-w-0 flex-1 overflow-hidden">{previewNode}</div>+ </div>{unread > 0 && (<spanaria-label={t(($) => $.session_history.row_subtitle.new_reply)}