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(ide): read re-joined agents as working; Done/Working/Reviewed columns
rubenluetke10-beep4f6830e8650f
diff --git a/jarvis/agentic_ide/activity.py b/jarvis/agentic_ide/activity.pyindex d1deb5a6d5..1797b24ade 100644--- a/jarvis/agentic_ide/activity.py+++ b/jarvis/agentic_ide/activity.py@@ -334,6 +334,8 @@ def _has_current_instruction(term: Any) -> bool:Continue submissions and is reset by spawning a new process, so it is thenarrow proof required before movement may become a live ``working`` claim."""+ if _adopted_with_work(term):+ return Trueif not getattr(term, "last_submit_at", None):return Falsetry:@@ -344,6 +346,23 @@ def _has_current_instruction(term: Any) -> bool:return False+def _adopted_with_work(term: Any) -> bool:+ """Is this the process re-joined after an app restart, already on a job?++ An agent that kept running in the PTY host through an app restart received+ its instruction in the previous app's lifetime, so no submit stamp of THIS+ app can prove it. ``Session._adopt_hosted`` records the proof it had then+ (a conversation on disk, prompts sent, work seen at the last checkpoint) as+ ``adopted_generation``; it holds only for that very process.+ """+ try:+ return int(getattr(term, "adopted_generation", -1)) == int(+ getattr(term, "process_generation", 0)+ )+ except (TypeError, ValueError):+ return False++def read_activity(term: Any, *, now: float | None = None, still_since: float | None = None) -> Activity:@@ -561,6 +580,8 @@ def has_work_behind_it(term: Any) -> bool:"""if getattr(term, "last_submit_at", None):return True+ if _adopted_with_work(term):+ return Truetry:if int(getattr(term, "prompts_sent", 0) or 0) > 0:return Truediff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.pyindex e94715ccd6..9f7f34afba 100644--- a/jarvis/agentic_ide/session.py+++ b/jarvis/agentic_ide/session.py@@ -1190,6 +1190,13 @@ class Terminal:# A startup repaint has no such stamp, even if the pane resumes an old# conversation whose historical prompt count is non-zero.submit_generation: int = -1+ # The process generation re-joined after an app restart while its agent+ # already had a job — a conversation on disk, prompts sent, or work seen at+ # the last checkpoint. The instruction behind that job was submitted in the+ # previous app's lifetime, so ``submit_generation`` cannot prove it; this+ # does, for exactly this process (a respawn moves the generation on).+ # Without it every re-joined agent read "done" while still working.+ adopted_generation: int = -1transcript: Transcript = field(default_factory=Transcript)# The RAW output stream, kept so the next viewer can be handed the screen# this pane is actually showing. Cleared on a fresh spawn, so what a viewer@@ -2336,10 +2343,31 @@ class Registry:term.resume_continuation_needed = Falseterm.started_at = info.started_at or time.time()term.last_output_at = time.time() if result.replay else None+ if await self._adopted_with_work(term):+ term.adopted_generation = term.process_generationlogger.info("Agentic IDE: {} re-joined its running agent after an app restart", term.name)+ @staticmethod+ async def _adopted_with_work(term: Terminal) -> bool:+ """Had this re-joined agent been given a job before the app restarted?++ Cheap proofs first; the conversation file is the one that survives a+ pane driven purely by hand (its submit stamps died with the old app).+ """+ if term.worked_while_detached or has_work_behind_it(term):+ return True+ if term.resume is None:+ return False+ try:+ return await asyncio.to_thread(+ has_conversation, term.agent, term.resume, account_home(term.agent, term.account)+ )+ except Exception as exc: # noqa: BLE001 - an unreadable history only costs the word+ logger.debug("Agentic IDE: could not check {}'s conversation: {}", term.name, exc)+ return False+def _adopted_callbacks(self, term: Terminal) -> tuple[Any, Any]:"""Output/exit callbacks for an agent this process did not start.diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.test.tsxindex aa3fe44435..174de79500 100644--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.test.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.test.tsx@@ -5,6 +5,7 @@ import { useIdeChatStore } from "@/store/ideChat";import { useIdeProjectsStore } from "@/store/ideProjects";import { useIdeSidePanelStore } from "@/store/ideSidePanel";import { usePaneRecapsStore } from "@/store/paneRecaps";+import { markPaneReviewed, usePaneReviewsStore } from "@/store/paneReviews";import type { TerminalRecap } from "@/lib/agenticIdeApi";import { resetWorkspacePanesPoll, useWorkspacePanesStore } from "@/store/workspacePanes";import type { WorkspacePaneRow } from "@/lib/agenticIdeApi";@@ -43,6 +44,7 @@ function pane(name: string, workspaceId: string, overrides: Partial<WorkspacePanbeforeEach(() => {resetWorkspacePanesPoll();useIdeSidePanelStore.setState({ spotlight: null });+ usePaneReviewsStore.setState({ reviewed: {} });usePaneRecapsStore.setState({ workspaceId: null, byName: {}, load: async () => {} });useWorkspacePanesStore.setState({panes: [@@ -77,67 +79,95 @@ beforeEach(() => {afterEach(cleanup);+const column = (id: string) => screen.getByTestId(`ide-agents-column-${id}`);+const panesIn = (id: string) =>+ Array.from(column(id).querySelectorAll('[data-testid="ide-workspace-agent-row"]')).map((row) =>+ row.getAttribute("data-pane"),+ );+describe("AgentsOverview", () => {- it("titles a card with the model's short goal instead of the call-sign", () => {+ it("sorts the active workspace's agents into Done, Working and Reviewed", () => {+ render(<AgentsOverview />);+ // T1 works; T2 asks and T3 finished — both need a look; w2's T1 is not here.+ expect(panesIn("working")).toEqual(["T1"]);+ expect(panesIn("done").sort()).toEqual(["T2", "T3"]);+ expect(panesIn("reviewed")).toEqual([]);+ expect(screen.getByTestId("ide-agents-column-count-done").textContent).toBe("2");+ const order = Array.from(document.querySelectorAll("[data-testid^='ide-agents-column-']"))+ .map((node) => node.getAttribute("data-testid"))+ .filter((id) => id && !id.includes("count"));+ expect(order).toEqual(["ide-agents-column-done", "ide-agents-column-working", "ide-agents-column-reviewed"]);+ });++ it("shows the brand mark, the goal and the live state on each card", () => {usePaneRecapsStore.setState({workspaceId: "w1",byName: { T2: { recap: "Login flow — flaky tests", source: "model" } as TerminalRecap },});render(<AgentsOverview />);- const rows = screen.getAllByTestId("ide-workspace-agent-row");- expect(rows[1].querySelector('[data-testid="ide-agent-title"]')?.textContent).toBe("Login flow — flaky tests");- expect(rows[1].textContent).not.toContain("T2");+ const t2 = column("done").querySelector('[data-pane="T2"]')!;+ expect(t2.querySelector('[data-testid="ide-agent-title"]')?.textContent).toBe("Login flow — flaky tests");+ expect(t2.querySelector('[data-testid="agent-mark-codex"]')).not.toBeNull();+ expect(t2.getAttribute("data-kind")).toBe("waiting");+ const t1 = column("working").querySelector('[data-pane="T1"]')!;+ expect(t1.querySelector('[data-testid="ide-agent-state"]')?.textContent).toContain("Working");});- it("lists only the active workspace agents with names and live dots", () => {+ it("moves a finished agent to Reviewed when its card is clicked, and focuses its pane", () => {render(<AgentsOverview />);- const rows = screen.getAllByTestId("ide-workspace-agent-row");- expect(rows.map((row) => row.getAttribute("data-pane"))).toEqual(["T1", "T2", "T3"]);- expect(screen.getByTestId("ide-workspace-agents-count").textContent).toBe("3 agents");- expect(rows[0].getAttribute("data-kind")).toBe("working");- expect(rows[1].getAttribute("data-kind")).toBe("waiting");- expect(rows[2].getAttribute("data-kind")).toBe("idle");- expect(rows[0].textContent).toContain("Claude Code");- expect(rows[0].querySelector('[data-testid="agent-mark-claude"]')).not.toBeNull();- expect(rows[1].querySelector('[data-testid="agent-mark-codex"]')).not.toBeNull();- expect(rows[1].textContent).toContain("Codex");+ fireEvent.click(column("done").querySelector('[data-pane="T3"]')!);+ expect(panesIn("reviewed")).toEqual(["T3"]);+ expect(useIdeChatStore.getState().paneRequest).toMatchObject({ workspaceId: "w1", pane: "T3" });+ expect(useIdeSidePanelStore.getState().spotlight).toEqual({ workspaceId: "w1", pane: "T3" });});- it("marks errors red and idle panes gray", () => {- useWorkspacePanesStore.setState({- panes: [- pane("T1", "w1", { status: "error", activity: "" }),- pane("T9", "w1", { status: "live", activity: "", worked: false }),- ],- });+ it("counts a click on the pane in the grid as a review too", () => {render(<AgentsOverview />);- const rows = screen.getAllByTestId("ide-workspace-agent-row");- expect(rows[0].getAttribute("data-kind")).toBe("error");- expect(rows[1].getAttribute("data-kind")).toBe("idle");+ act(() => markPaneReviewed("w1", "T2"));+ expect(panesIn("reviewed")).toEqual(["T2"]);});- it("switches the list when the workspace tab changes", () => {+ it("puts a reviewed agent back under Done once it finishes a newer job", () => {+ usePaneReviewsStore.setState({ reviewed: { "T3@w1": 100 } });+ useWorkspacePanesStore.setState({+ panes: [pane("T3", "w1", { activity: "waiting", activity_since: 50 })],+ });const { rerender } = render(<AgentsOverview />);- expect(screen.getAllByTestId("ide-workspace-agent-row")).toHaveLength(3);- act(() => useIdeProjectsStore.setState({ activeWorkspaceId: "w2" }));+ expect(panesIn("reviewed")).toEqual(["T3"]);+ act(() =>+ useWorkspacePanesStore.setState({ panes: [pane("T3", "w1", { activity: "waiting", activity_since: 200 })] }),+ );rerender(<AgentsOverview />);- const rows = screen.getAllByTestId("ide-workspace-agent-row");- expect(rows.map((row) => row.getAttribute("data-pane"))).toEqual(["T1"]);+ expect(panesIn("done")).toEqual(["T3"]);});- it("asks the IDE view to focus the pane on click", () => {+ it("keeps an agent nobody ever tasked out of Done", () => {+ useWorkspacePanesStore.setState({ panes: [pane("T9", "w1", { activity: "waiting", worked: false })] });render(<AgentsOverview />);- fireEvent.click(screen.getByRole("button", { name: /T2, Codex/ }));- expect(useIdeChatStore.getState().paneRequest).toMatchObject({ workspaceId: "w1", pane: "T2" });- expect(useIdeSidePanelStore.getState().spotlight).toEqual({ workspaceId: "w1", pane: "T2" });+ expect(panesIn("reviewed")).toEqual(["T9"]);+ expect(panesIn("done")).toEqual([]);+ });++ it("marks errors red", () => {+ useWorkspacePanesStore.setState({ panes: [pane("T1", "w1", { status: "error", activity: "" })] });+ render(<AgentsOverview />);+ const row = column("done").querySelector('[data-pane="T1"]')!;+ expect(row.getAttribute("data-kind")).toBe("error");+ });++ it("switches with the workspace tab", () => {+ const { rerender } = render(<AgentsOverview />);+ act(() => useIdeProjectsStore.setState({ activeWorkspaceId: "w2" }));+ rerender(<AgentsOverview />);+ expect(panesIn("working")).toEqual(["T1"]);+ expect(panesIn("done")).toEqual([]);});it("marks the card whose pane is spotlit", () => {useIdeSidePanelStore.setState({ spotlight: { workspaceId: "w1", pane: "T2" } });render(<AgentsOverview />);- const rows = screen.getAllByTestId("ide-workspace-agent-row");- expect(rows[1].getAttribute("aria-current")).toBe("true");- expect(rows[0].getAttribute("aria-current")).toBeNull();+ expect(column("done").querySelector('[data-pane="T2"]')?.getAttribute("aria-current")).toBe("true");+ expect(column("working").querySelector('[data-pane="T1"]')?.getAttribute("aria-current")).toBeNull();});it("shows an empty hint when the workspace has no agents", () => {@@ -146,58 +176,4 @@ describe("AgentsOverview", () => {expect(screen.queryByTestId("ide-workspace-agent-row")).toBeNull();expect(screen.getByTestId("ide-workspace-agents").textContent).toContain("No agents");});-- it("summarises the workspace by state, needs-input first", () => {- render(<AgentsOverview />);- const summary = screen.getByTestId("ide-agents-summary");- const kinds = Array.from(summary.querySelectorAll("[data-kind]")).map((node) => node.getAttribute("data-kind"));- expect(kinds).toEqual(["waiting", "working", "idle"]);- expect(summary.textContent).toContain("1 need input");- expect(summary.textContent).toContain("1 working");- });-- it("shows each agent's state, its last task and its last output", () => {- const now = Math.floor(Date.now() / 1000);- useWorkspacePanesStore.setState({- panes: [- pane("T1", "w1", {- activity: "working",- activity_since: now - 180,- last_output_at: now - 5,- recap: "Fix the login test",- }),- ],- });- render(<AgentsOverview />);- const row = screen.getByTestId("ide-workspace-agent-row");- expect(screen.getByTestId("ide-agent-state").textContent).toBe("Working · 3m");- expect(screen.getByTestId("ide-agent-title").textContent).toBe("Fix the login test");- expect(row.textContent).toMatch(/Last output \d+s ago/);- });-});--describe("stopping every agent", () => {- it("asks first, then stops the runtime and refreshes the workspace list", async () => {- const calls: string[] = [];- const realFetch = globalThis.fetch;- globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {- calls.push(`${init?.method ?? "GET"} ${String(input)}`);- return new Response(JSON.stringify({ ok: true, closed_workspaces: 2 }), { status: 200 });- }) as typeof fetch;- try {- render(<AgentsOverview />);- fireEvent.click(screen.getByTestId("ide-agents-stop-all"));- // Nothing is stopped by the first click — it only asks.- expect(calls).toEqual([]);- expect(screen.getByRole("alertdialog")).toBeTruthy();- await act(async () => {- fireEvent.click(screen.getByTestId("ide-agents-stop-confirm"));- });- expect(calls).toEqual(["POST /api/agentic-ide/runtime/stop"]);- expect(useIdeProjectsStore.getState().refreshRequest).not.toBeNull();- expect(screen.queryByRole("alertdialog")).toBeNull();- } finally {- globalThis.fetch = realFetch;- }- });});diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.tsxindex 8c4ed9ecaa..51931a4fe6 100644--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/AgentsOverview.tsx@@ -7,15 +7,19 @@ import { useIdeChatStore } from "@/store/ideChat";import { useIdeProjectsStore } from "@/store/ideProjects";import { useIdeSidePanelStore } from "@/store/ideSidePanel";import { useWorkspacePanes } from "@/store/workspacePanes";+import { usePaneReviewsStore } from "@/store/paneReviews";import { AgentMark } from "@/components/agentic/AgentMark";import { paneTitleFrom, usePaneRecapPoll, usePaneRecapsStore } from "@/store/paneRecaps";+import { CheckCheck, Eye, Loader2, type LucideIcon } from "lucide-react";import {+ COLUMN_ORDER,DOT_STYLE,- SUMMARY_ORDER,+ columnFor,compactSince,dotKindFor,stateKeyFor,workspaceAgents,+ type AgentColumn,type AgentDotKind,} from "./agentStatus";@@ -39,15 +43,27 @@ const STATE_TONE: Record<AgentDotKind, { text: string; pill: string }> = {idle: { text: "text-muted-foreground", pill: "bg-muted" },};+const COLUMN_ICON: Record<AgentColumn, LucideIcon> = {+ done: CheckCheck,+ working: Loader2,+ reviewed: Eye,+};+const COLUMN_TONE: Record<AgentColumn, string> = {+ done: "text-success",+ working: "text-accent",+ reviewed: "text-muted-foreground",+};+/*** What every coding agent of the workspace at the front is doing right now.*- * The side panel's Agents tab: a strip of state counts over one card per- * agent. A card leads with the agent's brand mark — which CLI it is is the- * first thing to read — then its call-sign, its state and for how long, what- * it is working on, and when it last printed anything. Rows stay live through- * the shared pane store; a click brings the pane forward and frames it in the- * grid (the `spotlight`), so the card and its terminal are visibly one thing.+ * The side panel's Agents tab, in three columns top to bottom: Done (finished+ * and not looked at yet — what needs the user), Working, and Reviewed (a+ * finished agent whose pane the user has clicked since; see+ * `store/paneReviews`). A card leads with the agent's brand mark, then its+ * goal, its state and for how long, and when it last printed anything. A click+ * brings the pane forward, frames it in the grid (the `spotlight`) and counts+ * as reviewing it.*/export function AgentsOverview() {const t = useT();@@ -60,22 +76,101 @@ export function AgentsOverview() {usePaneRecapPoll();const recaps = usePaneRecapsStore((state) => state);const mine = workspaceAgents(panes, activeWorkspaceId);+ const reviewed = usePaneReviewsStore((state) => state.reviewed);+ const markReviewed = usePaneReviewsStore((state) => state.markReviewed);const pushToast = useEventStore((state) => state.pushToast);const requestRefresh = useIdeProjectsStore((state) => state.requestRefresh);const [confirmStop, setConfirmStop] = useState(false);const [stopping, setStopping] = useState(false);- const counts = new Map<AgentDotKind, number>();- for (const pane of mine) {- const kind = dotKindFor(pane);- counts.set(kind, (counts.get(kind) ?? 0) + 1);- }+ const columns: Record<AgentColumn, WorkspacePaneRow[]> = { done: [], working: [], reviewed: [] };+ for (const pane of mine) columns[columnFor(pane, reviewed[pane.history_id])].push(pane);+ // Newest news first in Done and Reviewed; the longest-running job first in Working.+ const settledAt = (pane: WorkspacePaneRow) => pane.activity_since || 0;+ columns.done.sort((a, b) => settledAt(b) - settledAt(a));+ columns.reviewed.sort((a, b) => settledAt(b) - settledAt(a));+ columns.working.sort((a, b) => settledAt(a) - settledAt(b));const pick = (pane: WorkspacePaneRow) => {+ markReviewed(pane.history_id);setSpotlight({ workspaceId: pane.workspace_id, pane: pane.name });requestPane(pane.workspace_id, pane.name);};+ const card = (pane: WorkspacePaneRow) => {+ const kind = dotKindFor(pane);+ const style = DOT_STYLE[kind];+ const tone = STATE_TONE[kind];+ const stateLabel = t(`ide_side_panel.agents.state.${stateKeyFor(pane, kind)}`);+ const cli = pane.display_name || pane.agent;+ const selected =+ spotlight !== null && spotlight.workspaceId === pane.workspace_id && spotlight.pane === pane.name;+ const stateSince = compactSince(pane.activity_since, now);+ const lastOutput = compactSince(pane.last_output_at, now);+ const recap = recaps.workspaceId === pane.workspace_id ? recaps.byName[pane.name] : undefined;+ const title = paneTitleFrom(recap, pane);+ return (+ <li key={pane.history_id}>+ <button+ type="button"+ onClick={() => pick(pane)}+ aria-label={`${title || pane.name}, ${cli}, ${stateLabel}`}+ title={title ? `${title} (${pane.name})` : pane.name}+ aria-current={selected ? "true" : undefined}+ data-testid="ide-workspace-agent-row"+ data-pane={pane.name}+ data-kind={kind}+ className={cn(+ "group flex w-full items-center rounded-xl border p-3 text-left transition-[border-color,background-color,box-shadow] duration-150",+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",+ selected+ ? "border-accent bg-accent/[0.06] ring-1 ring-accent/40"+ : "border-border/60 bg-background/40 hover:border-border hover:bg-muted/50",+ )}+ >+ <span className="flex w-full items-start gap-3">+ <span className="relative shrink-0">+ <AgentMark agent={pane.agent} label={cli} size="md" />+ <span+ aria-hidden="true"+ className="absolute -bottom-0.5 -right-0.5 flex h-3 w-3 items-center justify-center rounded-full bg-card"+ >+ {style.ping && (+ <span className="absolute inset-0.5 animate-ping rounded-full bg-warning opacity-60 [animation-duration:1.8s] motion-reduce:hidden" />+ )}+ <span className={cn("relative h-2 w-2 rounded-full", style.dot)} />+ </span>+ </span>+ <span className="flex min-w-0 flex-1 flex-col gap-0.5">+ <span+ data-testid="ide-agent-title"+ className="line-clamp-2 text-sm font-semibold leading-snug text-foreground"+ >+ {title || cli}+ </span>+ <span className="truncate text-[11px] tabular-nums text-muted-foreground">+ {[title ? cli : "", lastOutput ? fill(t("ide_side_panel.agents.last_output"), { time: lastOutput }) : ""]+ .filter(Boolean)+ .join(" · ")}+ </span>+ </span>+ <span+ data-testid="ide-agent-state"+ className={cn(+ "shrink-0 rounded-md px-2 py-0.5 text-[11px] font-medium tabular-nums",+ tone.pill,+ tone.text,+ )}+ >+ {stateLabel}+ {stateSince && <span className="opacity-70"> · {stateSince}</span>}+ </span>+ </span>+ </button>+ </li>+ );+ };+// Closing the app only detaches from the agents (they live in a background// host), so ending them is a separate, deliberate action with its own confirm.const stopAll = async () => {@@ -98,112 +193,49 @@ export function AgentsOverview() {aria-label={t("ide_side_panel.agents.aria")}className="flex h-full min-h-0 flex-col">- {mine.length > 0 && (- <div data-testid="ide-agents-summary" className="shrink-0 space-y-2 px-3 pb-2 pt-3">- <div className="flex items-baseline justify-between px-1">- <span data-testid="ide-workspace-agents-count" className="text-sm font-semibold text-foreground">- {fill(t(mine.length === 1 ? "ide_side_panel.agents.count_one" : "ide_side_panel.agents.count_other"), { n: mine.length })}- </span>- </div>- <div className="flex flex-wrap gap-1.5">- {SUMMARY_ORDER.filter((kind) => counts.get(kind)).map((kind) => (- <span- key={kind}- data-kind={kind}- className={cn(- "inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium tabular-nums",- STATE_TONE[kind].pill,- STATE_TONE[kind].text,- )}- >- <span className={cn("h-1.5 w-1.5 rounded-full", DOT_STYLE[kind].dot)} aria-hidden="true" />- {fill(t(`ide_side_panel.agents.summary.${kind}`), { n: counts.get(kind) ?? 0 })}- </span>- ))}- </div>- </div>- )}-{activeWorkspaceId === null ? (<p className="px-4 py-3 text-sm text-muted-foreground">{t("ide_side_panel.agents.no_workspace")}</p>) : mine.length === 0 ? (<p className="px-4 py-3 text-sm text-muted-foreground">{t("ide_side_panel.agents.empty")}</p>) : (- <ul className="scrollbar-jarvis min-h-0 flex-1 space-y-2 overflow-y-auto px-3 pb-3 pt-1">- {mine.map((pane) => {- const kind = dotKindFor(pane);- const style = DOT_STYLE[kind];- const tone = STATE_TONE[kind];- const stateLabel = t(`ide_side_panel.agents.state.${stateKeyFor(pane, kind)}`);- const cli = pane.display_name || pane.agent;- const selected =- spotlight !== null && spotlight.workspaceId === pane.workspace_id && spotlight.pane === pane.name;- const since = compactSince(pane.activity_since, now);- const lastOutput = compactSince(pane.last_output_at, now);- const recap = recaps.workspaceId === pane.workspace_id ? recaps.byName[pane.name] : undefined;- const title = paneTitleFrom(recap, pane);+ <div className="scrollbar-jarvis min-h-0 flex-1 space-y-4 overflow-y-auto px-3 pb-3 pt-3">+ {COLUMN_ORDER.map((column) => {+ const Icon = COLUMN_ICON[column];+ const rows = columns[column];return (- <li key={pane.history_id}>- <button- type="button"- onClick={() => pick(pane)}- aria-label={`${title || pane.name}, ${cli}, ${stateLabel}`}- title={title ? `${title} (${pane.name})` : pane.name}- aria-current={selected ? "true" : undefined}- data-testid="ide-workspace-agent-row"- data-pane={pane.name}- data-kind={kind}- className={cn(- "group flex w-full items-center rounded-xl border p-3 text-left transition-[border-color,background-color,box-shadow] duration-150",- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",- selected- ? "border-accent bg-accent/[0.06] ring-1 ring-accent/40"- : "border-border/60 bg-background/40 hover:border-border hover:bg-muted/50",- )}- >- <span className="flex w-full items-start gap-3">- <span className="relative shrink-0">- <AgentMark agent={pane.agent} label={cli} size="md" />- <span- aria-hidden="true"- className="absolute -bottom-0.5 -right-0.5 flex h-3 w-3 items-center justify-center rounded-full bg-card"- >- {style.ping && (- <span className="absolute inset-0.5 animate-ping rounded-full bg-warning opacity-60 [animation-duration:1.8s] motion-reduce:hidden" />- )}- <span className={cn("relative h-2 w-2 rounded-full", style.dot)} />- </span>- </span>- <span className="flex min-w-0 flex-1 flex-col gap-0.5">- <span- data-testid="ide-agent-title"- className="line-clamp-2 text-sm font-semibold leading-snug text-foreground"- >- {title || cli}- </span>- <span className="truncate text-[11px] tabular-nums text-muted-foreground">- {[title ? cli : "", lastOutput ? fill(t("ide_side_panel.agents.last_output"), { time: lastOutput }) : ""]- .filter(Boolean)- .join(" · ")}- </span>- </span>- <span- data-testid="ide-agent-state"- className={cn(- "shrink-0 rounded-md px-2 py-0.5 text-[11px] font-medium tabular-nums",- tone.pill,- tone.text,- )}- >- {stateLabel}- {since && <span className="opacity-70"> · {since}</span>}- </span>+ <section+ key={column}+ data-testid={`ide-agents-column-${column}`}+ aria-label={t(`ide_side_panel.agents.columns.${column}`)}+ >+ <h3 className="mb-1.5 flex items-center gap-2 px-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground">+ <Icon+ aria-hidden+ className={cn(+ "h-3.5 w-3.5",+ COLUMN_TONE[column],+ column === "working" && rows.length > 0 && "animate-spin [animation-duration:2.4s] motion-reduce:animate-none",+ )}+ />+ <span>{t(`ide_side_panel.agents.columns.${column}`)}</span>+ <span+ data-testid={`ide-agents-column-count-${column}`}+ className="rounded bg-muted px-1.5 text-[10px] tabular-nums text-muted-foreground"+ >+ {rows.length}</span>- </button>- </li>+ </h3>+ {rows.length === 0 ? (+ <p className="rounded-lg border border-dashed border-border/60 px-3 py-2 text-[11px] text-muted-foreground">+ {t(`ide_side_panel.agents.column_empty.${column}`)}+ </p>+ ) : (+ <ul className="space-y-2">{rows.map(card)}</ul>+ )}+ </section>);})}- </ul>+ </div>)}{panes.length > 0 && (diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/IdeSidePanel.tsx b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/IdeSidePanel.tsxindex cb03ad15b4..f64b20ecd4 100644--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/IdeSidePanel.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/IdeSidePanel.tsx@@ -6,6 +6,7 @@ import { useResizablePane } from "@/hooks/useResizablePane";import { PaneResizer } from "@/components/layout/PaneResizer";import { useIdeSidePanelStore } from "@/store/ideSidePanel";import { useExplorerPathRouting } from "@/store/ideExplorer";+import { usePaneReviewTracking } from "@/store/paneReviews";import { useIdeProjectsStore } from "@/store/ideProjects";import { useWorkspacePanes } from "@/store/workspacePanes";import { dotKindFor, workspaceAgents } from "./agentStatus";@@ -38,6 +39,8 @@ export function IdeSidePanelFrame({ children }: { children: ReactNode }) {const open = useIdeSidePanelStore((state) => state.open);// Ctrl+click on a path in any terminal opens it in the Explorer tab.useExplorerPathRouting();+ // A click on a pane in the grid counts as reviewing that agent.+ usePaneReviewTracking();const frame = useRef<HTMLDivElement>(null);const [frameWidth, setFrameWidth] = useState(0);diff --git a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/agentStatus.ts b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/agentStatus.tsindex 50ac4b3d32..7a96cd6a61 100644--- a/jarvis/ui/web/frontend/src/components/agentic/sidePanel/agentStatus.ts+++ b/jarvis/ui/web/frontend/src/components/agentic/sidePanel/agentStatus.ts@@ -66,3 +66,25 @@ export function compactSince(at: number | null | undefined, nowMs: number = Dateif (seconds < 86_400) return `${Math.floor(seconds / 3600)}h`;return `${Math.floor(seconds / 86_400)}d`;}++/** The three columns of the Agents tab, top to bottom. */+export type AgentColumn = "done" | "working" | "reviewed";++export const COLUMN_ORDER: readonly AgentColumn[] = ["done", "working", "reviewed"];++/**+ * Where one agent belongs.+ *+ * Working is the live reading. Anything settled — finished, asking, failed —+ * is Done until the user looks at it, and Reviewed once a look is newer than+ * the moment it settled (`activity_since`), so a reviewed agent that finishes+ * another job comes back to Done. A pane never given a job has nothing to+ * review and waits under Reviewed.+ */+export function columnFor(pane: WorkspacePaneRow, reviewedAt: number | undefined): AgentColumn {+ const kind = dotKindFor(pane);+ if (kind === "working") return "working";+ if (kind === "idle" && !pane.worked) return "reviewed";+ if (reviewedAt !== undefined && reviewedAt >= (pane.activity_since || 0)) return "reviewed";+ return "done";+}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex d6cdad0493..53598c07b1 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -5807,6 +5807,16 @@"count_other": "{n} Agents","no_workspace": "Wähle einen Workspace, um seine Agents zu sehen.","empty": "In diesem Workspace laufen keine Agents.",+ "columns": {+ "done": "Fertig",+ "working": "Arbeitet",+ "reviewed": "Angesehen"+ },+ "column_empty": {+ "done": "Nichts Neues ist fertig geworden.",+ "working": "Gerade arbeitet kein Agent.",+ "reviewed": "Klicke einen fertigen Agent an, um ihn hierher zu verschieben."+ },"last_output": "Letzte Ausgabe vor {time}","runtime_note": "Agents laufen weiter, wenn du die App schließt.","stop_all": "Alle Agents stoppen",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex ca70cf9c21..1e6cb78352 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -5840,6 +5840,16 @@"count_other": "{n} agents","no_workspace": "Select a workspace to see its agents.","empty": "No agents running in this workspace.",+ "columns": {+ "done": "Done",+ "working": "Working",+ "reviewed": "Reviewed"+ },+ "column_empty": {+ "done": "Nothing new has finished.",+ "working": "No agent is working right now.",+ "reviewed": "Click a finished agent to move it here."+ },"last_output": "Last output {time} ago","runtime_note": "Agents keep running when you close the app.","stop_all": "Stop all agents",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 89de435f1b..5906afb769 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -5807,6 +5807,16 @@"count_other": "{n} agentes","no_workspace": "Selecciona un espacio de trabajo para ver sus agentes.","empty": "No hay agentes en este espacio de trabajo.",+ "columns": {+ "done": "Terminado",+ "working": "Trabajando",+ "reviewed": "Revisado"+ },+ "column_empty": {+ "done": "No ha terminado nada nuevo.",+ "working": "Ningún agente está trabajando ahora.",+ "reviewed": "Haz clic en un agente terminado para moverlo aquí."+ },"last_output": "Última salida hace {time}","runtime_note": "Los agentes siguen funcionando cuando cierras la app.","stop_all": "Detener todos los agentes",diff --git a/jarvis/ui/web/frontend/src/store/paneReviews.ts b/jarvis/ui/web/frontend/src/store/paneReviews.tsnew file mode 100644index 0000000000..bb8fa8dfcf--- /dev/null+++ b/jarvis/ui/web/frontend/src/store/paneReviews.ts@@ -0,0 +1,90 @@+import { useEffect } from "react";+import { create } from "zustand";++import { useIdeChatStore } from "@/store/ideChat";+import { useIdeProjectsStore } from "@/store/ideProjects";+import { useWorkspacePanesStore } from "@/store/workspacePanes";++/**+ * Which finished agents the user has already looked at.+ *+ * The Agents tab sorts every coding agent into Done, Working and Reviewed. A+ * finished agent moves from Done to Reviewed the moment its pane is clicked —+ * in the grid or on its card — and back to Done when it finishes a NEW job+ * (its settled-since stamp is then newer than the review). Kept per pane+ * lifetime id (`history_id`, stable across renames and restarts) with the+ * moment of the look, in localStorage so a reload or an app restart does not+ * put everything back under Done. Storage may be blocked; then the reviews+ * last for this session only.+ */+const STORAGE_KEY = "jarvis.agenticIde.paneReviews.v1";+/** Old entries are dropped beyond this many panes. */+const MAX_ENTRIES = 400;++function load(): Record<string, number> {+ try {+ const raw = JSON.parse(localStorage.getItem(STORAGE_KEY) ?? "{}") as unknown;+ if (!raw || typeof raw !== "object") return {};+ const out: Record<string, number> = {};+ for (const [key, value] of Object.entries(raw as Record<string, unknown>)) {+ if (typeof value === "number" && Number.isFinite(value)) out[key] = value;+ }+ return out;+ } catch {+ return {};+ }+}++function save(reviewed: Record<string, number>): void {+ try {+ localStorage.setItem(STORAGE_KEY, JSON.stringify(reviewed));+ } catch {+ /* a convenience only: reviews then last for this session */+ }+}++interface PaneReviewsState {+ /** history_id → epoch seconds of the last look. */+ reviewed: Record<string, number>;+ markReviewed: (historyId: string, atSeconds?: number) => void;+}++export const usePaneReviewsStore = create<PaneReviewsState>((set, get) => ({+ reviewed: load(),+ markReviewed: (historyId, atSeconds = Date.now() / 1000) => {+ if (!historyId) return;+ const next = { ...get().reviewed, [historyId]: atSeconds };+ const keys = Object.keys(next);+ if (keys.length > MAX_ENTRIES) {+ keys+ .sort((a, b) => next[a] - next[b])+ .slice(0, keys.length - MAX_ENTRIES)+ .forEach((key) => delete next[key]);+ }+ set({ reviewed: next });+ save(next);+ },+}));++/** Mark the pane of `workspaceId` called `name` as looked at, if it is known. */+export function markPaneReviewed(workspaceId: string | null, name: string | null): void {+ if (!workspaceId || !name) return;+ const pane = useWorkspacePanesStore+ .getState()+ .panes.find((row) => row.workspace_id === workspaceId && row.name === name);+ if (pane) usePaneReviewsStore.getState().markReviewed(pane.history_id);+}++/**+ * Count a click on a pane in the grid as reviewing it.+ *+ * The grid reports its selected pane as `stagedPane`; every change of it is a+ * pane the user just clicked or focused. Mounted once, beside the grid.+ */+export function usePaneReviewTracking(): void {+ const stagedPane = useIdeChatStore((state) => state.stagedPane);+ const workspaceId = useIdeProjectsStore((state) => state.activeWorkspaceId);+ useEffect(() => {+ markPaneReviewed(workspaceId, stagedPane);+ }, [stagedPane, workspaceId]);+}diff --git a/tests/unit/agentic_ide/test_pty_host_adoption.py b/tests/unit/agentic_ide/test_pty_host_adoption.pyindex d9e5988b32..401236c64c 100644--- a/tests/unit/agentic_ide/test_pty_host_adoption.py+++ b/tests/unit/agentic_ide/test_pty_host_adoption.py@@ -342,3 +342,41 @@ async def test_a_lost_host_is_reconnected_with_start_for_the_next_pane(assert not getattr(fallback, "persistent", False)assert await registry._live_manager() is fallback # noqa: SLF001assert connect.calls == [False, True, True]+++# ------------------------------------------- a re-joined agent keeps its job+async def test_a_rejoined_agent_that_had_a_job_reads_working_while_it_moves(+ tmp_path: Path,+) -> None:+ """Its instruction was sent before the restart; movement must still count.++ Maintainer report 2026-09-28: after an app restart, three agents visibly+ mid-task were listed "done" for the next half hour, because no submit stamp+ of the NEW app proved their work.+ """+ from jarvis.agentic_ide import activity++ pool = FakeHostedPool()+ registry = ide.Registry(pty_manager=pool)+ session = await registry.start(+ str(tmp_path), [{"agent": "claude", "name": "T1"}, {"agent": "claude", "name": "T2"}]+ )+ t1, t2 = session.find("T1"), session.find("T2")+ t1.prompts_sent = 2 # it had been given work before the restart+ pool.add_hosted("busy", history_id=t1.history_id, replay="Processing…")+ pool.add_hosted("fresh", history_id=t2.history_id, replay="")++ await registry._adopt_hosted(session) # noqa: SLF001 - the unit under test++ now = time.time()+ t1.last_output_at = now+ t2.last_output_at = now+ assert activity.read_activity(t1, now=now) == "working"+ # A re-joined pane nobody ever tasked keeps the strict rule: its repaint is+ # not work.+ assert activity.read_activity(t2, now=now) == "waiting"+ assert activity.has_work_behind_it(t1)++ # The proof belongs to that one process: a respawn moves the generation on.+ t1.process_generation += 1+ assert activity.read_activity(t1, now=now) == "waiting"