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.

feat(agentic-ide): the chat sidebar names each session by what it is about

rubenluetke10-beepe09c31d40c99
diff --git a/jarvis/agentic_ide/recap_engine.py b/jarvis/agentic_ide/recap_engine.py
index 8df62af285..d78bad81c0 100644
--- a/jarvis/agentic_ide/recap_engine.py
+++ b/jarvis/agentic_ide/recap_engine.py
@@ -377,6 +377,11 @@ class _PaneState:
pinned_headline: str = ""
pinned_detail: str = ""
pinned_at: float = 0.0
+ #: The deterministic headline the header last read off this pane's screen.
+ #: Kept so a reader that must NOT walk the scrollback — the session list,
+ #: which polls every pane of every open workspace — can still say what the
+ #: pane's header says (:func:`known_headline`).
+ floor_headline: str = ""
_panes: dict[str, _PaneState] = {}
@@ -559,15 +564,42 @@ def recap_for(term: Any, *, lines: Sequence[str] | None = None) -> SmartRecap:
writer=entry.writer,
)
plain = recap.summarize(term, lines=None if lines is None else list(lines))
+ reason = _why_no_summary(term, entry, None if lines is None else len(lines))
+ # Remember what the header is about to show, so a reader that cannot afford
+ # this read (see known_headline) can still repeat it.
+ key = str(getattr(term, "key", "") or "")
+ if key and plain.headline:
+ _state(key).floor_headline = plain.headline
return SmartRecap(
headline=plain.headline,
detail=plain.detail,
source=BY_RULES,
- reason=_why_no_summary(term, entry, None if lines is None else len(lines)),
+ reason=reason,
note=entry.note if entry is not None else "",
)
+def known_headline(term: Any) -> str:
+ """The pane's title as its header LAST showed it, without reading the pane.
+
+ :func:`recap_for` is the header's answer, and for the deterministic floor
+ it walks the pane's screen. The session list cannot afford that: it polls
+ every pane of every open workspace on a clock (``Terminal.to_row``), and
+ a dozen scrollback walks per tick is the difference between a list and a
+ stutter. But the list wants the SAME title the header shows, or one pane
+ is "Fix the login test" in the grid and "Claude Code" in the sidebar — two
+ names for one conversation. So this answers from memory alone, in the
+ header's own order: what the user pinned, else what the model wrote, else
+ the floor the header last computed. Empty for a pane no header has
+ described yet; the list then falls back to the pane's last prompt, and
+ only after that to the CLI's name.
+ """
+ entry = _panes.get(str(getattr(term, "key", "") or ""))
+ if entry is None:
+ return ""
+ return entry.pinned_headline or entry.headline or entry.floor_headline
+
+
def refresh_soon(term: Any, *, lines: Sequence[str], folder: str = "") -> None:
"""Start a summary for ``term`` in the background if one is due.
diff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.py
index 4a81bdaa23..179de07721 100644
--- a/jarvis/agentic_ide/session.py
+++ b/jarvis/agentic_ide/session.py
@@ -1286,6 +1286,13 @@ class Terminal:
# terminal has to a chat's title. Capped like the full state's copy.
"last_prompt": self.last_prompt[:200],
"last_prompt_at": self.last_prompt_at,
+ # The pane's title as its header last showed it — pinned, written by
+ # the model, or the floor read off the screen on the last header
+ # poll — from the recap engine's memory alone. Never computed here:
+ # this list must not walk a scrollback (see above). Empty for a pane
+ # no header has described yet; the list then shows the last
+ # prompt's opening, and only after that the CLI's name.
+ "recap": recap_engine.known_headline(self),
# Whether a readable conversation could exist for this pane at all.
# Whether one is actually on disk is the transcript endpoint's
# answer; this only says the pane holds a handle to look up.
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
index f796d00573..037e64839d 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
@@ -2511,6 +2511,10 @@ export function AgenticGrid({
agents?.find((choice) => choice.name === stagedTerm.agent)?.displayName ??
stagedTerm.agent
}
+ // The same recap the pane's own header wears (polled, else the one
+ // the workspace state carried), so the stage and the terminal
+ // behind it never name one pane two ways.
+ title={recaps[stagedTerm.name]?.recap ?? stagedTerm.recap}
activity={activityOf(stagedTerm).activity}
onShowTerminal={() => setStageMode("terminal")}
/>
diff --git a/jarvis/ui/web/frontend/src/components/agentic/PaneChat.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/PaneChat.test.tsx
index 2e9d618383..b9718d1b6a 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/PaneChat.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/PaneChat.test.tsx
@@ -177,6 +177,24 @@ describe("PaneChat", () => {
expect(onShowTerminal).toHaveBeenCalledTimes(1);
});
+ it("wears the pane's title in its header, with the CLI's name beside it", async () => {
+ vi.mocked(api.fetchTerminalTimeline).mockResolvedValue(answer());
+ renderStage({ title: "Fixing the login test" });
+ await screen.findByTestId("agent-turn");
+ const header = screen.getByTestId("pane-chat-T7").querySelector("header")!;
+ expect(screen.getByTestId("pane-chat-title").textContent).toBe("Fixing the login test");
+ expect(header.textContent).toContain("Claude Code");
+ });
+
+ it("names the CLI alone while no header has described the pane", async () => {
+ vi.mocked(api.fetchTerminalTimeline).mockResolvedValue(answer());
+ renderStage({ title: " " });
+ await screen.findByTestId("agent-turn");
+ expect(screen.queryByTestId("pane-chat-title")).toBeNull();
+ const header = screen.getByTestId("pane-chat-T7").querySelector("header")!;
+ expect(header.textContent).toContain("Claude Code");
+ });
+
it("flags a pane that is asking something only the terminal can answer", async () => {
vi.mocked(api.fetchTerminalTimeline).mockResolvedValue(answer());
renderStage({ activity: "asking" });
diff --git a/jarvis/ui/web/frontend/src/components/agentic/PaneChat.tsx b/jarvis/ui/web/frontend/src/components/agentic/PaneChat.tsx
index 5f1f1654a5..400920bf7b 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/PaneChat.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/PaneChat.tsx
@@ -35,6 +35,12 @@ export interface PaneChatProps {
agent: string;
/** What the CLI is called — "Claude Code", "Codex". */
agentLabel: string;
+ /**
+ * What the pane is about — its recap, the sentence the grid draws in the
+ * pane's own header. Empty until a header has described the pane; the
+ * CLI's name then carries the header alone, as it always did.
+ */
+ title?: string;
/** The workspace folder — the composer's chip and the empty page's headline. */
folder: string;
/** The grid's own reading of the pane: working, waiting, asking… */
@@ -49,6 +55,7 @@ export function PaneChat({
historyId,
agent,
agentLabel,
+ title = "",
folder,
activity,
onShowTerminal,
@@ -91,7 +98,25 @@ export function PaneChat({
<header className="flex h-11 shrink-0 items-center gap-2 border-b border-border px-4">
<MessageSquare className="h-4 w-4 shrink-0 text-primary" aria-hidden />
<span className="font-mono text-xs font-semibold text-foreground">{terminal}</span>
- <span className="min-w-0 flex-1 truncate text-sm text-muted-foreground">{agentLabel}</span>
+ {/* The pane's title where the sidebar row showed it too, so the header
+ and the row that opened it agree on what this conversation is; the
+ CLI's name steps aside to the right, the logo-sized fact it is. */}
+ {title.trim() ? (
+ <>
+ <span
+ className="min-w-0 flex-1 truncate text-sm text-foreground"
+ data-testid="pane-chat-title"
+ title={title}
+ >
+ {title}
+ </span>
+ <span className="max-w-[10rem] shrink-0 truncate text-xs text-muted-foreground">
+ {agentLabel}
+ </span>
+ </>
+ ) : (
+ <span className="min-w-0 flex-1 truncate text-sm text-muted-foreground">{agentLabel}</span>
+ )}
{pane.pollError && (
<span
role="status"
diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceChats.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceChats.test.tsx
index 643985094e..cee5ddb169 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceChats.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceChats.test.tsx
@@ -19,6 +19,7 @@ function pane(
displayName: string,
workspaceId: string,
status: WorkspacePaneRow["status"] = "live",
+ overrides: Partial<WorkspacePaneRow> = {},
): WorkspacePaneRow {
return {
workspace_id: workspaceId,
@@ -40,10 +41,12 @@ function pane(
last_output_at: 2,
last_prompt: "",
last_prompt_at: null,
+ recap: "",
has_resume: false,
readable: true,
account: null,
account_label: null,
+ ...overrides,
};
}
@@ -119,6 +122,31 @@ describe("the sidebar's chat face", () => {
expect(rowsOf(bands[1])[0].className).not.toContain("bg-card");
});
+ it("labels a session by what it is about, and names the CLI only when it was asked nothing", () => {
+ useWorkspacePanesStore.setState({
+ panes: [
+ pane("T1", "Claude Code", "w1", "live", { recap: "Fixing the login test" }),
+ pane("T2", "Claude Code", "w1", "live", {
+ last_prompt: "Refactor the parser so it streams.\nStart with config.py.",
+ }),
+ pane("T3", "Claude Code", "w1"),
+ ],
+ activeId: "w1",
+ loaded: true,
+ });
+ render(<WorkspaceChats />);
+
+ const titles = screen.getAllByTestId("workspace-session-title").map((el) => el.textContent);
+ expect(titles).toEqual([
+ "Fixing the login test",
+ "Refactor the parser so it streams.",
+ "Claude Code",
+ ]);
+ // The CLI's name is still one hover away, with the pane it runs in.
+ const row = screen.getAllByTestId("workspace-session-row")[0];
+ expect(row.getAttribute("title")).toBe("Fixing the login test · Claude Code · T1");
+ });
+
it("asks the view to bring the clicked session to the front, workspace and all", () => {
render(<WorkspaceChats />);
const bands = screen.getAllByTestId("workspace-chats-band");
diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceChats.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceChats.tsx
index 3e03d3ac83..1bc3f9898f 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceChats.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceChats.tsx
@@ -8,6 +8,7 @@ import {
} from "@/components/agentic/AgentPicker";
import { AgentMark } from "@/components/agentic/AgentMark";
import { folderColor } from "@/components/agentic/folderColor";
+import { sessionTitle } from "@/components/agentic/sessionTitle";
import { useIdeChatStore, type IdeWorkspaceRow } from "@/store/ideChat";
import { useWorkspacePanes } from "@/store/workspacePanes";
import type { WorkspacePaneRow } from "@/lib/agenticIdeApi";
@@ -276,8 +277,12 @@ function WorkspaceBand({
*
* Same height and indent as a chat row anywhere else in the app, because from
* where the user sits these are the same kind of thing: a conversation with
- * an agent. The mark is a terminal, and the dot carries the state the grid's
- * badge shows: running, waiting to start, or finished.
+ * an agent. The mark is the CLI's logo, the label is what the conversation is
+ * ABOUT — the pane's title, the same sentence its grid header wears (see
+ * `sessionTitle`) — the call-sign says which pane, and the dot carries the
+ * state the grid's badge shows: running, waiting to start, or finished. The
+ * CLI's name moved into the tooltip: nine rows all reading "Claude Code" under
+ * nine Claude logos said the same thing twice and the useful thing never.
*/
function SessionRow({
pane,
@@ -290,13 +295,14 @@ function SessionRow({
logoUrl?: string;
onOpen: () => void;
}) {
- const label = pane.display_name || pane.name;
+ const label = sessionTitle(pane);
+ const cli = pane.display_name || pane.agent;
return (
<li className="group relative">
<button
type="button"
onClick={onOpen}
- title={`${label} · ${pane.agent}`}
+ title={`${label} · ${cli} · ${pane.name}`}
data-testid="workspace-session-row"
data-pane={pane.name}
data-status={pane.status}
@@ -306,8 +312,13 @@ function SessionRow({
active ? "bg-card text-foreground shadow-sm" : "hover:bg-background/60",
)}
>
- <AgentMark agent={pane.agent} label={label} logoUrl={logoUrl} variant="plain" size="sm" />
- <span className="min-w-0 flex-1 truncate text-xs text-foreground">{label}</span>
+ <AgentMark agent={pane.agent} label={cli} logoUrl={logoUrl} variant="plain" size="sm" />
+ <span
+ className="min-w-0 flex-1 truncate text-xs text-foreground"
+ data-testid="workspace-session-title"
+ >
+ {label}
+ </span>
<span className="shrink-0 truncate font-mono text-[10px] text-muted-foreground/70">
{pane.name}
</span>
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sessionTitle.test.ts b/jarvis/ui/web/frontend/src/components/agentic/sessionTitle.test.ts
new file mode 100644
index 0000000000..6dd93ffa89
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/sessionTitle.test.ts
@@ -0,0 +1,42 @@
+/**
+ * A session row's label says what the conversation is for — the pane's title
+ * first, the prompt's opening next, and the CLI's name only when the pane has
+ * been asked nothing at all.
+ */
+import { describe, expect, it } from "vitest";
+
+import { promptOpening, sessionTitle } from "@/components/agentic/sessionTitle";
+
+const BARE = { recap: "", last_prompt: "", display_name: "Claude Code", name: "T1" };
+
+describe("sessionTitle", () => {
+ it("is the pane's recap when the header has one", () => {
+ expect(sessionTitle({ ...BARE, recap: "Fixing the login test", last_prompt: "Fix it" })).toBe(
+ "Fixing the login test",
+ );
+ });
+
+ it("falls back to the opening line of the last prompt", () => {
+ const brief = "Refactor the parser so it streams.\n\nStart with jarvis/core/config.py.";
+ expect(sessionTitle({ ...BARE, last_prompt: brief })).toBe("Refactor the parser so it streams.");
+ });
+
+ it("names the CLI only for a pane that was asked nothing", () => {
+ expect(sessionTitle(BARE)).toBe("Claude Code");
+ expect(sessionTitle({ ...BARE, recap: " " })).toBe("Claude Code");
+ expect(sessionTitle({ ...BARE, display_name: "" })).toBe("T1");
+ });
+});
+
+describe("promptOpening", () => {
+ it("skips blank leading lines and collapses whitespace", () => {
+ expect(promptOpening("\r\n \r\n Write the\ttests first \r\nthen ship")).toBe(
+ "Write the tests first",
+ );
+ });
+
+ it("is empty for an empty prompt", () => {
+ expect(promptOpening("")).toBe("");
+ expect(promptOpening(" \n ")).toBe("");
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/sessionTitle.ts b/jarvis/ui/web/frontend/src/components/agentic/sessionTitle.ts
new file mode 100644
index 0000000000..3a4a393242
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/sessionTitle.ts
@@ -0,0 +1,42 @@
+import type { WorkspacePaneRow } from "@/lib/agenticIdeApi";
+
+/**
+ * What a session is called in a list of them: what it is ABOUT, not which
+ * CLI runs it.
+ *
+ * Nine rows all reading "Claude Code" told the user nothing — the logo in
+ * front of each row already says which CLI it is, and the call-sign at the end
+ * says which pane; the label between them was the one place the list could
+ * say what the conversation is for, and it repeated the logo instead
+ * (maintainer report 2026-08-27). So the label is the pane's title, the same
+ * sentence the grid draws in that pane's header:
+ *
+ * 1. the recap — pinned by the user, written by the model, or the floor read
+ * off the screen on the last header poll (`known_headline` on the backend);
+ * 2. the opening line of the last prompt, for a pane no header has described
+ * yet — the closest thing a terminal has to a chat's first message;
+ * 3. the CLI's name, for a pane that has been asked nothing at all, where
+ * "Claude Code" is in fact everything there is to say.
+ */
+export function sessionTitle(
+ pane: Pick<WorkspacePaneRow, "recap" | "last_prompt" | "display_name" | "name">,
+): string {
+ const recap = (pane.recap ?? "").trim();
+ if (recap) return recap;
+ const opening = promptOpening(pane.last_prompt ?? "");
+ if (opening) return opening;
+ return pane.display_name || pane.name;
+}
+
+/**
+ * The first non-blank line of a prompt, whitespace collapsed.
+ *
+ * A composed brief runs to paragraphs; a title is one line, and the row's own
+ * width clips it further. The first line rather than the first N characters,
+ * because a brief opens with its instruction and the cut then lands between
+ * sentences instead of inside a word.
+ */
+export function promptOpening(prompt: string): string {
+ const line = prompt.split(/\r?\n/).find((row) => row.trim()) ?? "";
+ return line.replace(/\s+/g, " ").trim();
+}
diff --git a/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts b/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts
index 36bbff207b..2b3a2a023f 100644
--- a/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts
+++ b/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts
@@ -799,6 +799,12 @@ export interface WorkspacePaneRow {
/** The opening of the last prompt — a terminal's closest thing to a title. */
last_prompt: string;
last_prompt_at: number | null;
+ /**
+ * The pane's title as its grid header last showed it — pinned, model-written,
+ * or read off the screen. Empty for a pane no header has described yet; see
+ * `sessionTitle` for what a list shows then.
+ */
+ recap: string;
has_resume: boolean;
/** Can this pane's conversation be opened as a page? */
readable: boolean;
diff --git a/tests/unit/agentic_ide/test_recap_engine.py b/tests/unit/agentic_ide/test_recap_engine.py
index 701887266e..af9ebf9e8b 100644
--- a/tests/unit/agentic_ide/test_recap_engine.py
+++ b/tests/unit/agentic_ide/test_recap_engine.py
@@ -82,6 +82,42 @@ def test_a_closed_pane_forgets_its_recap() -> None:
assert recap_engine.recap_for(term, lines=[]).source == recap_engine.BY_RULES
+# ------------------------------------------------------ the title from memory
+
+
+def test_a_pane_no_header_has_described_has_no_known_headline() -> None:
+ """The list falls back on its own; this must not walk the pane to answer."""
+ assert recap_engine.known_headline(_pane(lines=3)) == ""
+
+
+def test_the_known_headline_is_what_the_header_last_showed() -> None:
+ """One pane, one title: the list repeats the header's floor, then the model's."""
+ term = _pane(lines=3, last_prompt="Fix the failing login test")
+
+ shown = recap_engine.recap_for(term, lines=term.transcript.lines())
+ assert recap_engine.known_headline(term) == shown.headline
+ assert "Fix the failing login test" in recap_engine.known_headline(term)
+
+ state = recap_engine._state(term.key) # noqa: SLF001 - the cache under test
+ state.headline = "Wrote the login fix, tests green"
+ state.generated_at = time.time()
+ assert recap_engine.known_headline(term) == "Wrote the login fix, tests green"
+
+ recap_engine.pin(term.key, "Login rework")
+ assert recap_engine.known_headline(term) == "Login rework"
+
+
+def test_the_session_row_carries_the_known_headline_without_a_walk() -> None:
+ """``to_row`` is the list's payload: it repeats the title, it never computes one."""
+ term = _pane(lines=3, last_prompt="Fix the failing login test")
+ assert term.to_row()["recap"] == ""
+
+ recap_engine.recap_for(term, lines=term.transcript.lines())
+
+ assert term.to_row()["recap"] == recap_engine.known_headline(term)
+ assert term.to_row()["recap"] != ""
+
+
# ------------------------------------------------------------- when it refreshes