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): stop resize repaints reading as agent work
Ruben Lütke9922e9d6a3cb
diff --git a/jarvis/agentic_ide/activity.py b/jarvis/agentic_ide/activity.pyindex bde8272e78..4180807a4e 100644--- a/jarvis/agentic_ide/activity.py+++ b/jarvis/agentic_ide/activity.py@@ -80,7 +80,7 @@ and the failure would at least be VISIBLE rather than the silent one itreplaces: a badge stuck on "working" gets reported, a badge wrongly saying"done" is believed.-## The one exclusion+## The two exclusions**Movement in the shadow of a keystroke is not the agent working.** A terminalechoes what a person types, so a pane being typed into is a pane whose screen@@ -89,6 +89,19 @@ moment the user pauses to think the pane is reported finished. Keystrokes arestamped on the pane (``Terminal.last_input_at``) and movement in their shadowdoes not count.+**Movement in the shadow of a resize is not the agent working either.** A+full-screen TUI answers a size change by redrawing its whole frame, and that+redraw is real output AND a changed screen — both signals at once. Sizes change+constantly in ordinary use: switching between the grid and the chat view,+maximizing a pane, dragging a seam, switching workspace tabs (whose reconnect+deliberately nudges a repaint), resizing the window. Every one of those made+every FINISHED pane in the workspace read as "working" for a few seconds — at+exactly the moment the user was looking at the list to see what had finished+(maintainer report 2026-08-01). Resizes are stamped on the pane+(``Terminal.last_resize_at``) and movement in their shadow does not count; an+agent that really is working keeps producing output after the shadow passes and+is read as working again within a couple of seconds.+## Honest limitsAn agent whose process WEDGES stops repainting, so it reads as finished a few@@ -144,6 +157,19 @@ Activity = Literal["starting", "working", "waiting", "asking", "failed", "exited#: nothing is filed until a pane has been quiet for roughly ten seconds.STILL_S = 4.0+#: How long after a PTY resize any movement is read as the redraw the resize+#: caused rather than as the agent working.+#:+#: A TUI answers a size change within a few hundred milliseconds (the repaint+#: nudge waits 0.08 s between its two sizes and the paint follows immediately),+#: so two seconds cover the slowest observed redraw with room to spare — while+#: staying far below any real job. The cost is bounded and visible: an agent+#: genuinely working through a resize reads as "waiting" for at most this long,+#: then its next output falls outside the shadow and it reads as working again.+#: The silent failure this replaces was the reverse and unbounded in number:+#: every layout change relabelled every finished pane "working".+RESIZE_SHADOW_S = 2.0+#: How many of the pane's visible rows the fingerprint covers.#:#: The BOTTOM of the screen: a TUI keeps its status row, its spinner and its@@ -247,6 +273,21 @@ def _fresh(moment: float, at: float | None) -> bool:return 0 <= moment - float(at) <= STILL_S+def _resize_shadowed(term: Any, at: float | None) -> bool:+ """Did ``at`` fall in the shadow of this pane's last resize?++ Movement stamped there is the TUI redrawing its frame for the new geometry,+ not the agent working — see the module docstring. Asked about the moment the+ MOVEMENT happened (the output stamp, the screen-change stamp), never about+ "now": the redraw arrives within the shadow, but its stamp stays fresh for+ :data:`STILL_S` beyond it, and judging by "now" would let that tail through.+ """+ resized_at = getattr(term, "last_resize_at", None)+ if not resized_at or not at:+ return False+ return 0 <= float(at) - float(resized_at) <= RESIZE_SHADOW_S++def _moving(term: Any, moment: float, still_since: float | None) -> bool:"""Is anything happening in this pane right now?@@ -254,12 +295,14 @@ def _moving(term: Any, moment: float, still_since: float | None) -> bool:arrived, or a screen seen to CHANGE — the latter tracked by the calleracross sweeps and passed in as ``still_since``, since a single look cannotsee movement. A caller without that history simply asks the first question.+ Movement in the shadow of a keystroke or a resize counts for neither."""if _typing_now(term, moment):return False- if _fresh(moment, getattr(term, "last_output_at", None)):+ out_at = getattr(term, "last_output_at", None)+ if _fresh(moment, out_at) and not _resize_shadowed(term, out_at):return True- return _fresh(moment, still_since)+ return _fresh(moment, still_since) and not _resize_shadowed(term, still_since)def read_activity(@@ -410,6 +453,7 @@ def has_work_behind_it(term: Any) -> bool:__all__ = ["ASK_FRAGMENTS","NO_READING",+ "RESIZE_SHADOW_S","SETTLED","STAMP_FRESH_S","STILL_S",diff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.pyindex f0d13476ef..515566670c 100644--- a/jarvis/agentic_ide/session.py+++ b/jarvis/agentic_ide/session.py@@ -834,6 +834,13 @@ class Terminal:# agent is working only when nobody is at the keyboard. Without it, pausing# mid-sentence in a pane reads as an agent that just finished.last_input_at: float | None = None+ # When this pane's PTY was last RESIZED — a re-join with a new geometry, a+ # grid re-layout, the repaint nudge. A full-screen TUI answers a size change+ # by redrawing its whole frame, and that redraw is output plus a changed+ # screen: exactly the two signals the activity detector reads as "working".+ # Movement in the shadow of this stamp is the pane being redrawn, not the+ # agent working — see `activity._resize_shadowed`.+ last_resize_at: float | None = Noneprompts_sent: int = 0last_prompt: str = ""# The current process's records are kept as a fallback if the local history@@ -2438,6 +2445,9 @@ class Registry:geometry_changed = manager.resize(term.pty_id, cols, rows)if geometry_changed:term.transcript.resize(cols, rows)+ # The TUI is about to redraw itself for the new geometry;+ # that redraw must not read as the agent working.+ term.last_resize_at = time.time()needs_repaint = term.replay.truncatedif geometry_changed and is_coding_agent(term.agent):# A cursor-addressed TUI stream is meaningful only at the size@@ -2927,6 +2937,9 @@ class Registry:manager.resize(pty_id, cols, max(rows - 1, 2))await asyncio.sleep(REPAINT_NUDGE_S)manager.resize(pty_id, cols, rows)+ # The whole point of the nudge is a full repaint — which must read+ # as the redraw it is, not as the agent suddenly working.+ term.last_resize_at = time.time()except Exception as exc: # noqa: BLE001 - a stale screen beats a failed reconnectlogger.debug("Agentic IDE: could not nudge {} into a repaint: {}", term.name, exc)@@ -3001,6 +3014,10 @@ class Registry:return Trueif not self._manager().resize(term.pty_id, cols, rows):return False+ # The TUI answers the new size with a full redraw — shadow it so a+ # finished pane does not read as "working" every time the grid+ # re-lays itself out (chat view toggle, maximize, a dragged seam).+ term.last_resize_at = time.time()if is_coding_agent(term.agent):# Future viewers must not replay cursor moves produced for the old# grid into the new one. The live viewer already has its screen;diff --git a/tests/unit/agentic_ide/test_pane_activity_status.py b/tests/unit/agentic_ide/test_pane_activity_status.pyindex 41b861f0b4..1f858c9cf8 100644--- a/tests/unit/agentic_ide/test_pane_activity_status.py+++ b/tests/unit/agentic_ide/test_pane_activity_status.py@@ -27,7 +27,7 @@ import pytestfrom jarvis.agentic_ide import notificationsfrom jarvis.agentic_ide import session as session_mod-from jarvis.agentic_ide.activity import STAMP_FRESH_S, observed+from jarvis.agentic_ide.activity import RESIZE_SHADOW_S, STAMP_FRESH_S, observedfrom jarvis.agentic_ide.session import PLAIN_TERMINAL, Registryfrom tests.fakes.fake_pty_manager import FakePtyManager@@ -162,6 +162,63 @@ async def test_a_keystroke_echo_is_still_not_the_agent_working(assert term.to_dict()["activity"] == "waiting"+async def test_a_resize_repaint_is_not_the_agent_working(+ registry: Registry, tmp_path: Path+) -> None:+ """The other exclusion: a redraw for a new geometry is not work.++ The reported bug (2026-08-01). Switching between the grid and the chat+ view, maximizing, dragging a seam or changing tabs resizes every pane, a+ TUI answers a size change with a full repaint, and that repaint is fresh+ output AND a changed picture — so every FINISHED pane in the workspace+ read as "working" at exactly the moment the user looked at the list.+ """+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed(REST_SCREENS["claude"])+ now = time.time()+ _sweep(registry, now - notifications.SWEEP_INTERVAL_S)+ # The grid re-laid itself out: PTY resized, TUI repainted — both signals.+ term.last_resize_at = now - 0.5+ term.last_output_at = now+ term.transcript.clear()+ term.transcript.feed(REST_SCREENS["claude"] + "\r\n ")+ _sweep(registry, now)++ assert term.to_dict()["activity"] == "waiting"+++async def test_output_after_the_resize_shadow_still_counts_as_working(+ registry: Registry, tmp_path: Path+) -> None:+ """The shadow is a window, not a mute button.++ An agent genuinely working through a resize keeps printing after the+ redraw; its next stamp falls outside the shadow and must count again —+ otherwise a resize would hide real work instead of a repaint.+ """+ _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_resize_at = now - RESIZE_SHADOW_S - 1.0+ term.last_output_at = now+ _sweep(registry, now)++ assert term.to_dict()["activity"] == "working"+++async def test_a_grid_relayout_stamps_the_resize_shadow(+ registry: Registry, tmp_path: Path+) -> None:+ """The viewer's resize path leaves the stamp the detector reads."""+ _session, term = await _pane(registry, tmp_path)+ assert term.last_resize_at is None++ assert registry.resize("Alex", 120, 40) is True++ assert term.last_resize_at is not None++# --------------------------------------------- the reading reaches a client