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(agentic-ide): read a pane as working from its output, not only its bottom rows
Ruben Lütkec689a2902919
diff --git a/jarvis/agentic_ide/activity.py b/jarvis/agentic_ide/activity.pyindex f14f0d1334..bde8272e78 100644--- a/jarvis/agentic_ide/activity.py+++ b/jarvis/agentic_ide/activity.py@@ -50,14 +50,35 @@ own blinking cursor, keeps a clock in a status bar, or emits a heartbeat — anyof which would have sunk this approach, which is why it was measured first.:data:`STILL_S` sits eight times above the longest observed gap.-## Screen CONTENT, not bytes--Bytes arriving is the weaker signal and would be the tempting one, since it-needs no state. A terminal receives plenty of bytes that change nothing a-person can see: cursor moves, a row repainted with identical characters, replies-to the emulator queries a CLI makes at startup. Fingerprinting the visible rows-answers "did anything CHANGE", which is the question. (Bytes are still used as-a fallback for a caller that has no previous screen to compare against.)+## Two signals, and why BOTH are needed++**Either fresh output or a changed screen means working.** The first version+used the screen alone, on the reasoning that a terminal receives plenty of bytes+that change nothing a person can see — cursor moves, a row repainted with+identical characters, replies to the emulator queries a CLI makes at startup —+so fingerprinting the visible rows answers the sharper question.++That reasoning was right about the noise and wrong about the cost. The+fingerprint covers the BOTTOM :data:`TAIL_ROWS` rows, and a pane whose visible+change happens anywhere else — an agent streaming its answer into a tall pane,+a CLI whose busy row sits above the input box, a screen scrolling under a static+footer — is a pane working in a blind spot. Measured on the maintainer's own+workspace of eleven panes (2026-07-31), that read finished agents and working+ones the same way, and the badge on half the list was wrong.++The measurement that settles which signal to trust: in that same workspace,+every RESTING pane had produced no output at all for between 19 and 69 seconds,+and every WORKING pane had produced some within the last tenth of a second.+There is no ambiguous middle, so bytes answer the question on their own — while+the screen fingerprint stays as the second signal, because it survives one+sweep longer than the byte stamp and holds the answer steady across the gap.++The one thing this costs: a CLI that ticks at rest — a blinking cursor of its+own, a clock in a status bar, a heartbeat — would read as permanently working.+None of the four installed products does any of that (measured twice, above),+and the failure would at least be VISIBLE rather than the silent one it+replaces: a badge stuck on "working" gets reported, a badge wrongly saying+"done" is believed.## The one exclusion@@ -215,26 +236,30 @@ def _typing_now(term: Any, moment: float) -> bool:return 0 <= since <= STILL_S+def _fresh(moment: float, at: float | None) -> bool:+ """Did ``at`` happen inside the window that counts as "just now"?++ A stamp in the FUTURE is not freshness — it is a clock that does not agree+ with the caller's. Silence is the honest answer.+ """+ if not at:+ return False+ return 0 <= moment - float(at) <= STILL_S++def _moving(term: Any, moment: float, still_since: float | None) -> bool:- """Has this pane's screen changed recently enough to call it busy?+ """Is anything happening in this pane right now?- ``still_since`` is when the screen was last seen to CHANGE, tracked by the- caller across sweeps. Without it — a caller with no previous screen to- compare against — this falls back to "bytes arrived recently", which is the- weaker form of the same question and errs towards "busy".+ Either signal is enough (see the module docstring): output that has just+ arrived, or a screen seen to CHANGE — the latter tracked by the caller+ across sweeps and passed in as ``still_since``, since a single look cannot+ see movement. A caller without that history simply asks the first question."""if _typing_now(term, moment):return False- if still_since is None:- last_out = getattr(term, "last_output_at", None)- if not last_out:- return False- since = moment - float(last_out)- return 0 <= since <= STILL_S- since = moment - float(still_since)- # A stamp in the FUTURE is not freshness — it is a clock that does not agree- # with the caller's. Silence is the honest answer.- return 0 <= since <= STILL_S+ if _fresh(moment, getattr(term, "last_output_at", None)):+ return True+ return _fresh(moment, still_since)def read_activity(@@ -340,27 +365,46 @@ def observed(term: Any, *, now: float | None = None) -> Reading:return Reading(read_activity(term, now=moment), 0.0)-def has_been_tasked(term: Any) -> bool:- """Has anybody ever given this pane an instruction?+def has_work_behind_it(term: Any) -> bool:+ """Is this pane's stillness a FINISHED job, or an untouched terminal?++ Both look identical on screen — a prompt and nothing moving — and they are+ not the same news, so the word for them must not be the same either.++ Three proofs, because a pane can be driven three ways:- Two proofs, because a pane can be driven two ways and both count. A- timestamp from the moment something was submitted into it — by Jarvis or by- a person pressing Enter — and the counter of prompts Jarvis has sent, which- is the half that survives into a restored workspace where the timestamp does- not. A pane typed into by hand before a restart therefore starts its next- life unproven, and is described as merely idle rather than as finished: a- missing claim, rather than an invented one.+ * something was submitted into it, by Jarvis or by a person pressing Enter;+ * Jarvis has sent it prompts (the half that survives a restored workspace+ where the timestamp does not);+ * or it CONTINUED an existing conversation when its process started, which+ is only ever true of a conversation that really exists on disk — the+ resume path checks (``has_conversation``) before claiming it, because a+ pane opened and never used leaves nothing behind to continue.- It is what separates "this agent finished the job" from "this terminal has- never been asked for anything", which are the same STILL SCREEN and must not- be the same word.+ That third one is deliberately NOT the same as "it holds a conversation+ id": every pane is handed one at launch, used or not, so an id proves+ nothing about whether anybody has spoken to it.++ The third proof is why this is not the same question as the bell's+ ``notifications._tasked``, which deliberately answers only the first two.+ That one decides whether to ANNOUNCE a completion, and a restored pane+ repainting itself would otherwise ring the bell for every terminal in the+ workspace on every restart. This one only chooses a word for a pane already+ standing still, where "it resumed a real conversation" is exactly the+ evidence that its quiet screen is a finished job.++ Getting that wrong is what this fixes: after a restart, every pane driven by+ hand — the maintainer's whole workspace — was labelled "idle" next to a+ recap saying it had worked for ten minutes."""if getattr(term, "last_submit_at", None):return Truetry:- return int(getattr(term, "prompts_sent", 0) or 0) > 0+ if int(getattr(term, "prompts_sent", 0) or 0) > 0:+ return Trueexcept (TypeError, ValueError): # a test double may carry anything- return False+ pass+ return bool(getattr(term, "resumed", False))__all__ = [@@ -372,7 +416,7 @@ __all__ = ["TAIL_ROWS","Activity","Reading",- "has_been_tasked",+ "has_work_behind_it","is_settled","observed","read_activity",diff --git a/jarvis/agentic_ide/notifications.py b/jarvis/agentic_ide/notifications.pyindex ade739487b..9d8681fb81 100644--- a/jarvis/agentic_ide/notifications.py+++ b/jarvis/agentic_ide/notifications.py@@ -94,15 +94,7 @@ from typing import TYPE_CHECKING, Any, Literal, NamedTuplefrom loguru import logger-from .activity import (- STILL_S,- Activity,- has_been_tasked,- is_settled,- read_activity,- screen_digest,- stamp,-)+from .activity import STILL_S, Activity, is_settled, read_activity, screen_digest, stampif TYPE_CHECKING: # pragma: no cover - typing onlyfrom collections.abc import Iterable, Mapping@@ -619,15 +611,30 @@ class ActivityWatcher:def _tasked(term: Any) -> bool:- """Has anybody ever given this pane an instruction?-- The rule itself lives in :func:`~.activity.has_been_tasked`, because the- pane list asks the same question for the same reason: a still screen means- "finished" only for a pane that was given something to finish, and- "untouched" for one that never was. Two copies of that rule would drift into- a bell that reports a completion the pane list calls idle.+ """Has anybody given this pane an instruction it could have finished?++ Two proofs, because a pane can be driven two ways and both count. A+ timestamp from the moment something was submitted into it — by Jarvis or by+ a person pressing Enter — and the counter of prompts Jarvis has sent, which+ is the half that survives into a restored workspace where the timestamp does+ not. A pane typed into by hand before a restart therefore starts its next+ life unproven, and stays quiet until the next thing is typed into it: a+ missing notice, rather than an invented one.++ Deliberately STRICTER than :func:`~.activity.has_work_behind_it`, which the+ pane list uses for the same-looking question. That one only picks a word for+ a pane already standing still, so "it resumed a real conversation" is fair+ evidence there. This one decides whether to interrupt somebody — and a+ restored pane repainting its old transcript satisfies "was working, then+ stopped" all by itself, so accepting the same evidence here would ring the+ bell once per terminal on every restart."""- return has_been_tasked(term)+ if getattr(term, "last_submit_at", None):+ return True+ try:+ return int(getattr(term, "prompts_sent", 0) or 0) > 0+ except (TypeError, ValueError): # a test double may carry anything+ return Falsedef _is_agent(term: Any) -> bool:diff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.pyindex 11d1e9943a..f0d13476ef 100644--- a/jarvis/agentic_ide/session.py+++ b/jarvis/agentic_ide/session.py@@ -79,7 +79,7 @@ from loguru import loggerfrom jarvis.workspace import agents as workspace_agentsfrom . import prompt_history, recap_engine, resume_store-from .activity import NO_READING, Reading, has_been_tasked, observed+from .activity import NO_READING, Reading, has_work_behind_it, observedfrom .agent_sessions import (ResumeHandle,can_resume,@@ -1113,7 +1113,7 @@ class Terminal:"activity_since": reading.since,# Whether a still screen means "finished" or "never asked for# anything" — the same picture, and not the same news.- "tasked": has_been_tasked(self),+ "worked": has_work_behind_it(self),"resumed": self.resumed,# Continued its old conversation and has had no instruction since —# the pane a restart left standing still. Carried in the ordinarydiff --git a/jarvis/ui/web/agentic_ide_routes.py b/jarvis/ui/web/agentic_ide_routes.pyindex 81d23f6f09..4c0a1dc569 100644--- a/jarvis/ui/web/agentic_ide_routes.py+++ b/jarvis/ui/web/agentic_ide_routes.py@@ -74,7 +74,7 @@ from jarvis.agentic_ide import (recents,resume_store,)-from jarvis.agentic_ide.activity import has_been_tasked+from jarvis.agentic_ide.activity import has_work_behind_itfrom jarvis.agentic_ide.agent_sessions import has_conversationfrom jarvis.agentic_ide.device import device_namefrom jarvis.agentic_ide.fleet_actions import (@@ -918,12 +918,13 @@ class TerminalRecap(BaseModel):"be shown with how long it has been waiting. 0 when unknown."),)- tasked: bool = Field(+ worked: bool = Field(default=False,description=(- "Has this pane ever been given an instruction? It is what separates "- "an agent that FINISHED from a terminal nobody has asked for "- "anything — the same still screen, and not the same news."+ "Has anything ever been asked of this pane — an instruction sent to "+ "it, or the conversation it resumed? It is what separates an agent "+ "that FINISHED from a terminal nobody has asked for anything: the "+ "same still screen, and not the same news."),)@@ -2063,7 +2064,7 @@ def _recap_row(term: Terminal, summary: recap_engine.SmartRecap) -> TerminalReca# pane itself; neither is recomputed here, or the two would drift.activity=reading.activity,activity_since=reading.since,- tasked=has_been_tasked(term),+ worked=has_work_behind_it(term),)diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsxindex 3fdda7e0f5..1556e49c7e 100644--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx@@ -2416,6 +2416,50 @@ describe("chat view", () => {expect(screen.queryByTestId("chat-rail-agent-menu")).toBeNull();});+ /*+ * Closing ONE terminal from the rail.+ *+ * Chat view shows a single pane and hides the other eleven — and with them+ * the pane header that used to be the only per-terminal close. So the rail+ * carries its own, and it goes through the same confirmation as the header:+ * closing a pane kills whatever its agent was doing, and there is no undo.+ */+ it("closes one terminal from its row in the rail", async () => {+ const survivors = sessionWith([+ ["Mika", 0],+ ["Nova", 1],+ ["Kai", 3],+ ]);+ vi.mocked(api.closeTerminal).mockResolvedValue(survivors);+ const { onSessionChanged } = renderGrid(FOUR);+ toChat();++ fireEvent.click(screen.getByTestId("chat-rail-close-Aria"));+ // Asked, never done on the spot — closing a pane kills a working agent.+ expect(api.closeTerminal).not.toHaveBeenCalled();+ expect(screen.getByText(/Close Aria\?/)).toBeTruthy();++ fireEvent.click(screen.getByTestId("confirm-close-terminal-confirm"));+ await waitFor(() => expect(api.closeTerminal).toHaveBeenCalledWith("Aria"));+ // The grid does not own the workspace; it reports the new one upwards.+ await waitFor(() => expect(onSessionChanged).toHaveBeenCalledWith(survivors));+ await waitFor(() =>+ expect(screen.queryByTestId("confirm-close-terminal")).toBeNull(),+ );+ });++ it("keeps the rail's close out of selection mode", () => {+ // That mode is here to close SEVERAL panes; a per-row close beside a+ // checkbox is two answers to one question.+ renderGrid(FOUR);+ toChat();+ expect(screen.getByTestId("chat-rail-close-Nova")).toBeTruthy();++ fireEvent.click(screen.getByTestId("terminal-selection-toggle"));++ expect(screen.queryByTestId("chat-rail-close-Nova")).toBeNull();+ });+it("an emptied workspace asks the same question", async () => {// The message shown when every pane is closed opens a terminal too, and it// is the only way back — so it offers the same list rather than guessing.diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsxindex 3d02158c73..8f9795a3bf 100644--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx@@ -733,7 +733,7 @@ export function AgenticGrid({return {activity: row?.activity ?? term.activity ?? "",since: row?.activity_since ?? term.activity_since ?? 0,- tasked: row?.tasked ?? term.tasked ?? false,+ worked: row?.worked ?? term.worked ?? false,};};@@ -1921,63 +1921,104 @@ export function AgenticGrid({const marked = selectedTerminals.has(term.name);const active = chatSelected === term.name;return (- <button- key={term.key}- type="button"- data-testid={`chat-rail-${term.name}`}- aria-label={`${title}, ${term.display_name || term.agent}`}- aria-pressed={selectionMode ? marked : active}- onClick={() =>- // Selection mode borrows the rail: in chat view the grid's- // per-pane overlays are hidden with their panes, so the- // rail is where a multi-close is composed.- selectionMode- ? toggleTerminalSelection(term.name)- : selectChatPane(term.name, takesPrompts(term))- }- className={cn(- "mb-1 w-full rounded-lg border px-2.5 py-2 text-left transition-colors",- selectionMode && marked- ? "border-primary bg-primary/10"- : active && !selectionMode- ? "border-primary/50 bg-primary/10"- : "border-transparent hover:bg-secondary",- )}- >- <span className="flex items-center gap-1.5">- {selectionMode && (- <Check- className={cn(- "h-3.5 w-3.5 shrink-0",- marked ? "text-primary" : "text-transparent",- )}- />+ /*+ * The row and its close button are SIBLINGS, never nested: a+ * button inside a button is invalid HTML, and browsers resolve+ * it by dropping one of them — usually the one you wanted.+ */+ <div key={term.key} className="group relative mb-1">+ <button+ type="button"+ data-testid={`chat-rail-${term.name}`}+ aria-label={`${title}, ${term.display_name || term.agent}`}+ aria-pressed={selectionMode ? marked : active}+ onClick={() =>+ // Selection mode borrows the rail: in chat view the grid's+ // per-pane overlays are hidden with their panes, so the+ // rail is where a multi-close is composed.+ selectionMode+ ? toggleTerminalSelection(term.name)+ : selectChatPane(term.name, takesPrompts(term))+ }+ className={cn(+ "w-full rounded-lg border px-2.5 py-2 text-left transition-colors",+ selectionMode && marked+ ? "border-primary bg-primary/10"+ : active && !selectionMode+ ? "border-primary/50 bg-primary/10"+ : "border-transparent hover:bg-secondary",)}- <span className="flex min-w-0 flex-1 items-center gap-1.5">- <span- data-testid={`chat-rail-title-${term.name}`}- className="min-w-0 truncate text-xs font-semibold"- title={title}- >- {title}+ >+ {/* The right padding is permanent, not applied on hover:+ the close button appears where the badge would otherwise+ be, and a status pill that jumps sideways under the+ cursor is a row nobody can aim at. */}+ <span className="flex items-center gap-1.5 pr-5">+ {selectionMode && (+ <Check+ className={cn(+ "h-3.5 w-3.5 shrink-0",+ marked ? "text-primary" : "text-transparent",+ )}+ />+ )}+ <span className="flex min-w-0 flex-1 items-center gap-1.5">+ <span+ data-testid={`chat-rail-title-${term.name}`}+ className="min-w-0 truncate text-xs font-semibold"+ title={title}+ >+ {title}+ </span>+ <AgentMark+ agent={term.agent}+ label={term.display_name || term.agent}+ size="sm"+ className="h-5 w-5 rounded-[4px]"+ /></span>- <AgentMark- agent={term.agent}- label={term.display_name || term.agent}- size="sm"- className="h-5 w-5 rounded-[4px]"+ {/* Not "live". Every pane in this list is live, all day —+ what the user is scanning for is which of them still+ owes them something. See ./PaneActivityPill. */}+ <PaneActivityPill+ status={state?.status ?? "connecting"}+ detail={state?.detail}+ {...activityOf(term)}/></span>- {/* Not "live". Every pane in this list is live, all day —- what the user is scanning for is which of them still- owes them something. See ./PaneActivityPill. */}- <PaneActivityPill- status={state?.status ?? "connecting"}- detail={state?.detail}- {...activityOf(term)}- />- </span>- </button>+ </button>+ {/*+ Closing one terminal from the list itself.+ Chat view hides every pane but the one on the stage, and with+ it the header that used to be the only place a single+ terminal could be closed — so the eleven panes you are NOT+ looking at could only be closed by switching to the grid or+ by composing a multi-select. This is the row's own button.++ Left out of selection mode on purpose: that mode is here to+ close SEVERAL, and a per-row close beside a checkbox is two+ answers to one question.+ */}+ {!selectionMode && (+ <button+ type="button"+ data-testid={`chat-rail-close-${term.name}`}+ disabled={busy || working}+ onClick={() => setPendingClose(term.name)}+ title={`Close ${term.name} and stop what is running in it`}+ aria-label={`Close ${term.name}`}+ className={cn(+ "absolute right-1 top-1.5 flex h-5 w-5 items-center justify-center rounded",+ "text-muted-foreground opacity-0 transition-opacity",+ "hover:bg-destructive/20 hover:text-destructive",+ "group-hover:opacity-100 group-focus-within:opacity-100",+ "focus-visible:opacity-100 disabled:cursor-not-allowed",+ )}+ >+ <X className="h-3.5 w-3.5" />+ </button>+ )}+ </div>);})}</div>diff --git a/jarvis/ui/web/frontend/src/components/agentic/PaneActivityPill.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/PaneActivityPill.test.tsxindex cf52f2240b..ca20217b9b 100644--- a/jarvis/ui/web/frontend/src/components/agentic/PaneActivityPill.test.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/PaneActivityPill.test.tsx@@ -29,7 +29,7 @@ describe("what the badge says", () => {it("says done for a pane that was given a job and has stopped", () => {expect(- pill({ status: "live", activity: "waiting", tasked: true }).textContent,+ pill({ status: "live", activity: "waiting", worked: true }).textContent,).toBe("done");});@@ -38,7 +38,7 @@ describe("what the badge says", () => {// job for a terminal that was never given one, and read as "your work is// ready" on a pane that has done none.expect(- pill({ status: "live", activity: "waiting", tasked: false }).textContent,+ pill({ status: "live", activity: "waiting", worked: false }).textContent,).toBe("idle");});@@ -91,7 +91,7 @@ describe("how long it has been that way", () => {const badge = pill({status: "live",activity: "waiting",- tasked: true,+ worked: true,since: NOW_S - 180,});expect(badge.textContent).toBe("done");diff --git a/jarvis/ui/web/frontend/src/components/agentic/PaneActivityPill.tsx b/jarvis/ui/web/frontend/src/components/agentic/PaneActivityPill.tsxindex de4489d699..e633523111 100644--- a/jarvis/ui/web/frontend/src/components/agentic/PaneActivityPill.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/PaneActivityPill.tsx@@ -38,10 +38,9 @@ import type { PaneActivity } from "@/lib/agenticIdeApi";** A finished agent and a terminal nobody has ever spoken to show the SAME still* screen. Calling both "done" would invent a job for the second one, and be- * read as "your work is ready" for a pane that has done none. `tasked` — has- * anything ever been sent here — is what separates them, and it is the same- * evidence the notification bell uses before claiming a pane completed- * anything.+ * read as "your work is ready" for a pane that has done none. `worked` — has+ * anything ever been asked of this pane, including the conversation it resumed+ * — is what separates them.** Nothing here claims the work is CORRECT. "done" means the pane went quiet,* which is all a terminal can prove.@@ -151,12 +150,12 @@ const CONNECTED: Look = {function lookFor(status: string,activity: PaneActivity,- tasked: boolean,+ worked: boolean,): Look {if (status === "error") return BROKEN;if (status === "exited") return EXITED;if (status !== "live") return CONNECTING;- if (activity === "waiting") return tasked ? DONE : IDLE;+ if (activity === "waiting") return worked ? DONE : IDLE;if (activity === "") return CONNECTED;return LOOK[activity];}@@ -192,7 +191,7 @@ export function PaneActivityPill({detail,activity = "",since = 0,- tasked = false,+ worked = false,now,}: {/** The socket's own view: `connecting`, `live`, `exited`, `error`. */@@ -202,12 +201,12 @@ export function PaneActivityPill({activity?: PaneActivity;/** When the pane entered this state (epoch seconds); 0 when unknown. */since?: number;- /** Has this pane ever been given an instruction? */- tasked?: boolean;+ /** Has anything ever been asked of this pane? */+ worked?: boolean;/** Injectable clock, in milliseconds — the tests do not race the wall. */now?: number;}) {- const look = lookFor(status, activity, tasked);+ const look = lookFor(status, activity, worked);// How long it has been in this state, when the backend knows. Only in the// tooltip: the badge itself sits in a 64-pixel column beside a call-sign, and// a number that changes every second there is movement without information.diff --git a/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts b/jarvis/ui/web/frontend/src/lib/agenticIdeApi.tsindex 5e82eb2080..c7b1a9f3a5 100644--- a/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts+++ b/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts@@ -143,8 +143,8 @@ export interface TerminalState {activity?: PaneActivity;/** When it entered that state (epoch seconds); 0 when unknown. */activity_since?: number;- /** Has this pane ever been given an instruction? */- tasked?: boolean;+ /** Has anything ever been asked of this pane? */+ worked?: boolean;}/**@@ -221,12 +221,13 @@ export interface TerminalRecap {/** When it entered that state (epoch seconds); 0 when unknown. */activity_since?: number;/**- * Has this pane ever been given an instruction?+ * Has anything ever been asked of this pane — an instruction sent to it, or+ * the conversation it resumed?** What separates "this agent finished" from "nobody has asked this terminal* for anything" — the same still screen, and not the same news.*/- tasked?: boolean;+ worked?: boolean;}export interface RecapsResponse {diff --git a/tests/unit/agentic_ide/test_pane_activity_parity.py b/tests/unit/agentic_ide/test_pane_activity_parity.pyindex 796f5d7a0c..cd7aefe75e 100644--- a/tests/unit/agentic_ide/test_pane_activity_parity.py+++ b/tests/unit/agentic_ide/test_pane_activity_parity.py@@ -59,7 +59,7 @@ def test_activity_python_typescript_and_ui_parity() -> None:def test_the_route_ships_the_reading() -> None:"""A word nothing carries is a word the UI never sees."""- assert {"activity", "activity_since", "tasked"} <= set(TerminalRecap.model_fields)+ assert {"activity", "activity_since", "worked"} <= set(TerminalRecap.model_fields)def test_activity_expected_vocabulary() -> None:diff --git a/tests/unit/agentic_ide/test_pane_activity_status.py b/tests/unit/agentic_ide/test_pane_activity_status.pyindex 0588030312..170ba8bf22 100644--- a/tests/unit/agentic_ide/test_pane_activity_status.py+++ b/tests/unit/agentic_ide/test_pane_activity_status.py@@ -119,6 +119,49 @@ async def test_a_moving_pane_is_reported_as_working_whatever_it_runs(assert term.to_dict()["activity"] == "working"+async def test_output_outside_the_fingerprint_still_counts_as_working(+ registry: Registry, tmp_path: Path+) -> None:+ """A pane printing steadily is working, wherever on the screen it shows.++ The reported bug. The fingerprint covers the BOTTOM rows only, so an agent+ streaming an answer into a tall pane — or any CLI whose busy row sits above+ its input box — was a pane working in a blind spot, and the badge said+ "done" over a terminal that was mid-sentence. Fresh output is now a signal+ in its own right: measured on eleven real panes, a resting one had printed+ nothing for between 19 and 69 seconds.+ """+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed(REST_SCREENS["claude"])+ now = time.time()+ _sweep(registry, now - notifications.SWEEP_INTERVAL_S)+ # Bytes arriving, fingerprint deliberately unchanged.+ term.last_output_at = now+ _sweep(registry, now)++ assert term.to_dict()["activity"] == "working"+++async def test_a_keystroke_echo_is_still_not_the_agent_working(+ registry: Registry, tmp_path: Path+) -> None:+ """The one exclusion survives the wider signal.++ A terminal echoes what a person types, so a pane being typed into is a pane+ producing output — without this, writing a prompt by hand reads as a busy+ agent, and the moment the user pauses the pane is reported finished.+ """+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed(REST_SCREENS["claude"])+ now = time.time()+ _sweep(registry, now - notifications.SWEEP_INTERVAL_S)+ term.last_output_at = now+ term.last_input_at = now+ _sweep(registry, now)++ assert term.to_dict()["activity"] == "waiting"++# --------------------------------------------- the reading reaches a client@@ -192,7 +235,7 @@ async def test_a_pane_nobody_instructed_is_not_called_finished(state = term.to_dict()assert state["activity"] == "waiting"- assert state["tasked"] is False+ assert state["worked"] is Falseasync def test_a_pane_that_was_given_a_job_is(registry: Registry, tmp_path: Path) -> None:@@ -202,7 +245,41 @@ async def test_a_pane_that_was_given_a_job_is(registry: Registry, tmp_path: Pathterm.transcript.feed(REST_SCREENS["claude"])_watched(registry, term, moves=False)- assert term.to_dict()["tasked"] is True+ assert term.to_dict()["worked"] is True+++async def test_a_resumed_conversation_counts_as_work_behind_the_pane(+ registry: Registry, tmp_path: Path+) -> None:+ """The bug the maintainer reported: a whole workspace labelled "idle".++ Restarting the app gives every pane a fresh process, so the stamp saying+ "somebody typed in here" is gone — and a workspace of agents that had each+ worked for ten minutes came back describing itself as untouched. A resumed+ conversation is proof somebody talked to this pane; nothing else needs to+ survive the restart for the badge to be honest.+ """+ _session, term = await _pane(registry, tmp_path)+ term.last_submit_at = None+ term.prompts_sent = 0+ term.resumed = True+ term.transcript.feed(REST_SCREENS["claude"])+ _watched(registry, term, moves=False)++ assert term.to_dict()["worked"] is True+++async def test_the_bell_is_not_widened_with_it(registry: Registry, tmp_path: Path) -> None:+ """The bell keeps the strict rule, and that difference is load-bearing.++ A restored pane repaints its old transcript — which is "was working, then+ stopped" — so accepting a resumed conversation as evidence THERE would file+ a completion for every terminal in the workspace on every restart.+ """+ _session, term = await _pane(registry, tmp_path)+ term.resumed = True++ assert notifications._tasked(term) is Falseasync def test_the_two_readings_of_one_pane_agree(registry: Registry, tmp_path: Path) -> None: