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): a single printout no longer spins the status badge
rubenluetke10-beep7ca50c79e5f9
diff --git a/jarvis/agentic_ide/activity.py b/jarvis/agentic_ide/activity.pyindex 6b5f843fe8..9ae85361ae 100644--- a/jarvis/agentic_ide/activity.py+++ b/jarvis/agentic_ide/activity.py@@ -401,6 +401,25 @@ STAMP_FRESH_S = 6.0#: LIVE process — see the module docstring.SUBMIT_GRACE_S = 10.0+#: How long movement must LAST before the badge calls a pane working.+#:+#: The inverse problem of the submit grace, reported the same day: any single+#: printout into a once-instructed pane — a slash command's output, a menu, a+#: redraw the user caused — kept the raw reading on ``working`` for the whole+#: :data:`STILL_S` freshness tail, so the badge spun over an agent that was+#: sitting at its prompt (the maintainer watched it spin right after ``/recap``+#: printed). Real work is not a burst: every measured CLI repaints at least+#: twice a second for as long as it is busy, so genuine work sustains movement+#: indefinitely while a burst's tail dies after ``STILL_S``. Strictly above+#: ``STILL_S`` for exactly that reason — a lone burst can never outlive it.+#:+#: The cost is bounded and covered: a pane that starts working WITHOUT a fresh+#: submit shows its spinner this many seconds late, and the one start a user+#: actually watches — their own Send — is carried by :data:`SUBMIT_GRACE_S`,+#: which outlasts this window. The notification sweep keeps the raw reading;+#: this gate is applied to the STAMPED word only (see ``notifications._step``).+WORK_CONFIRM_S = 5.0+class Reading(NamedTuple):"""What a pane is doing, and when it started doing it.@@ -440,6 +459,22 @@ def stamp(term: Any, activity: Activity, *, now: float) -> None:term.activity_at = now+def in_submit_wake(term: Any, moment: float) -> bool:+ """Did ``moment`` fall inside the wake of a confirmed submission?++ True while ``moment`` is within :data:`SUBMIT_GRACE_S` of an instruction+ that verifiably reached the LIVE process. The window where a still screen+ may claim ``working`` (:func:`observed`), and where movement needs no+ confirmation before the badge spins (``notifications._step``) — output+ arriving this soon after a submit is the agent starting, not the user+ printing something into the pane.+ """+ if not _has_current_instruction(term):+ return False+ at = float(getattr(term, "last_submit_at", 0.0) or 0.0)+ return 0 <= moment - at <= SUBMIT_GRACE_S++def _submit_graced(term: Any, reading: Reading, moment: float) -> Reading:"""``working`` for the first seconds after a submit, before movement shows.@@ -449,12 +484,9 @@ def _submit_graced(term: Any, reading: Reading, moment: float) -> Reading:"""if reading.activity != "waiting":return reading- if not _has_current_instruction(term):+ if not in_submit_wake(term, moment):return reading- at = float(getattr(term, "last_submit_at", 0.0) or 0.0)- if 0 <= moment - at <= SUBMIT_GRACE_S:- return Reading("working", at)- return reading+ return Reading("working", float(getattr(term, "last_submit_at", 0.0) or 0.0))def observed(term: Any, *, now: float | None = None) -> Reading:@@ -526,10 +558,12 @@ __all__ = ["STAMP_FRESH_S","STILL_S","SUBMIT_GRACE_S",+ "WORK_CONFIRM_S","TAIL_ROWS","Activity","Reading","has_work_behind_it",+ "in_submit_wake","is_moving","is_settled","observed",diff --git a/jarvis/agentic_ide/notifications.py b/jarvis/agentic_ide/notifications.pyindex 9c3e8bec47..0bd9071eaf 100644--- a/jarvis/agentic_ide/notifications.py+++ b/jarvis/agentic_ide/notifications.py@@ -97,7 +97,9 @@ from loguru import loggerfrom .activity import (RESIZE_SHADOW_S,STILL_S,+ WORK_CONFIRM_S,Activity,+ in_submit_wake,is_moving,is_settled,read_activity,@@ -346,6 +348,12 @@ class _PaneWatch:#: survive several PTYs; reusing the previous one's digest fabricates a#: still observation for the replacement process.process_generation: int = 0+ #: When the CURRENT movement episode began, ``None`` while the pane is+ #: still. What lets the stamped word demand that movement OUTLAST a single+ #: burst (``WORK_CONFIRM_S``) before the badge spins — the raw reading+ #: calls a pane working for the whole ``STILL_S`` tail of any lone+ #: printout, slash-command output included.+ moving_since: float | None = Nonedef _detail(term: Any) -> str:@@ -481,7 +489,10 @@ class ActivityWatcher:process_generation=process_generation,)self._panes[ident] = watch- stamp(term, activity, now=now)+ # Through the same movement-confirmation gate as every later sweep:+ # a restored pane replaying its transcript is fresh output too, and+ # first sight is not a reason to trust a burst more.+ stamp(term, self._confirmed(term, watch, activity, now), now=now)self._checkpoint_resume_state(term, activity, watch, now)return None@@ -519,7 +530,18 @@ class ActivityWatcher:# The pane list shows this on every pane, all the time, while an entry# is filed once per episode and only for the few states that are news —# so an early return below must never cost the UI its status.- stamp(term, activity, now=now)+ #+ # Publish the CONFIRMED word, not the raw one. Raw "working" covers the+ # whole STILL_S tail of any single printout — a slash command's output,+ # a menu, a redraw the user caused — and the badge spinning over an+ # agent that is sitting at its prompt is exactly the slot machine the+ # maintainer reported (2026-08-07, right after /recap printed). Real+ # work repaints continuously and sustains the episode past+ # WORK_CONFIRM_S; a burst's tail cannot. The bell below keeps the raw+ # reading: its transitions are already debounced by SETTLE_S, and the+ # user's own Send is carried through the confirm window by the submit+ # grace in `observed`.+ stamp(term, self._confirmed(term, watch, activity, now), now=now)self._checkpoint_resume_state(term, activity, watch, now)if watch.announced:@@ -555,6 +577,33 @@ class ActivityWatcher:))+ def _confirmed(self, term: Any, watch: _PaneWatch, activity: Activity, now: float) -> Activity:+ """The word the badge wears: movement must outlast a single burst.++ Tracks when the current movement episode began and reports ``waiting``+ until it has lasted ``WORK_CONFIRM_S`` — strictly longer than the+ freshness tail one lone printout leaves behind, so a slash command's+ output can never spin the badge, while a genuinely working agent+ (repainting at least twice a second, measured) confirms within a few+ sweeps.++ Movement whose episode BEGAN in the wake of a confirmed submission+ needs no waiting: output that soon after a Send is the agent starting,+ not the user printing something into the pane — and it is what hands+ the badge over seamlessly from the submit grace (which covers the+ still seconds before the first paint) to the observed movement.+ """+ if activity != "working":+ watch.moving_since = None+ return activity+ if watch.moving_since is None:+ watch.moving_since = now+ if in_submit_wake(term, watch.moving_since):+ return activity+ if now - watch.moving_since < WORK_CONFIRM_S:+ return "waiting"+ return activity+def _checkpoint_resume_state(self, term: Any, activity: Activity, watch: _PaneWatch, now: float) -> None:diff --git a/tests/unit/agentic_ide/test_pane_activity_status.py b/tests/unit/agentic_ide/test_pane_activity_status.pyindex bdd627c00b..4fce0d9855 100644--- a/tests/unit/agentic_ide/test_pane_activity_status.py+++ b/tests/unit/agentic_ide/test_pane_activity_status.py@@ -460,6 +460,80 @@ async def test_the_bell_keeps_the_strict_movement_rule(registry: Registry, tmp_passert reading == "waiting"+async def test_a_single_printout_does_not_spin_the_badge(+ registry: Registry, tmp_path: Path+) -> None:+ """The slot machine (maintainer report 2026-08-07, with screenshot).++ ``/recap`` printed its answer into a pane whose agent was waiting for+ input, and the badge spun for the whole freshness tail of that one burst —+ as it did for every menu, slash command and user-caused redraw. One+ printout is not an agent at work: real work repaints continuously, a burst+ dies within ``STILL_S``, and the stamped word now demands the difference.+ """+ _session, term = await _pane(registry, tmp_path)+ _instruct(term, 100.0) # instructed long ago — no submit wake, no grace+ term.transcript.feed(REST_SCREENS["claude"])+ _sweep(registry, 500.0)+ _sweep(registry, 502.0)+ assert observed(term, now=502.0).activity == "waiting"++ # A local command prints once — fresh bytes AND a changed picture.+ term.transcript.feed("\r\nrecap: shipped the status badge fix\r\n")+ term.last_output_at = 504.0+ for at in (504.0, 506.0, 508.0):+ _sweep(registry, at)+ assert observed(term, now=at).activity == "waiting"+++async def test_sustained_repainting_still_reads_as_working(+ registry: Registry, tmp_path: Path+) -> None:+ """And the confirmation window costs real work only its first seconds.++ An agent that is genuinely busy repaints at least twice a second for as+ long as it runs, so its movement episode outlives the burst tail and the+ badge spins — a few seconds late without a fresh submit, instantly with+ one (the wake rule, covered below).+ """+ _session, term = await _pane(registry, tmp_path)+ _instruct(term, 100.0) # outside the submit wake: the strict path+ term.transcript.feed(REST_SCREENS["claude"])+ _sweep(registry, 500.0)+ _sweep(registry, 502.0)++ for at in (504.0, 506.0, 508.0, 510.0):+ term.transcript.feed(f"\r\n· step at {at}\r\n")+ term.last_output_at = at+ _sweep(registry, at)++ assert observed(term, now=510.0).activity == "working"+++async def test_movement_in_a_submits_wake_confirms_instantly(+ registry: Registry, tmp_path: Path+) -> None:+ """Output right after a Send is the agent starting, not a stray printout.++ The seam between the submit grace (a still pane may claim working for ten+ seconds after Send) and observed movement: without this, a slow first+ paint landing late in the grace would flap the badge back to "done" while+ the confirmation window ran. Movement whose episode begins in the wake of+ a confirmed submission needs no further proof.+ """+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed(REST_SCREENS["claude"])+ _sweep(registry, 500.0)+ _sweep(registry, 502.0)++ _instruct(term, 503.0) # Send+ term.transcript.feed("\r\n· Scurrying…\r\n")+ term.last_output_at = 504.0 # first paint, one second later+ _sweep(registry, 504.0)++ assert observed(term, now=504.0).activity == "working"++async def test_the_two_readings_of_one_pane_agree(registry: Registry, tmp_path: Path) -> None:"""The workspace state and the pane-list poll describe the same pane alike.