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): report a just-submitted pane as working before it paints
rubenluetke10-beep8a9a9a768cb1
diff --git a/jarvis/agentic_ide/activity.py b/jarvis/agentic_ide/activity.pyindex 33e7bad851..6b5f843fe8 100644--- a/jarvis/agentic_ide/activity.py+++ b/jarvis/agentic_ide/activity.py@@ -101,6 +101,27 @@ exactly the moment the user was looking at the list to see what had finishedagent that really is working keeps producing output after the shadow passes andis read as working again within a couple of seconds.+## The moment after Send — the movement rule's one blind window++Movement proves work, but it arrives LATE at exactly the moment the user is+looking: right after they submit. An agent can take several seconds to produce+its first byte, and movement in the shadow of the submitting keystroke is+deliberately discounted (see the exclusions below) — so a pane that was just+handed work read as "waiting", which under a freshly pressed Send looks like a+send that silently failed (maintainer report 2026-08-07, repeated after the+badge's poll was made fast — the lag was here, not in the poll).++The submission itself is the missing evidence. It is stamped only when an+instruction verifiably reached the live process (:func:`_has_current_instruction`+— injected prompts confirm on screen, a hand-pressed Enter is verified before+it stamps), so for :data:`SUBMIT_GRACE_S` after the stamp a still pane is+reported ``working`` by :func:`observed`. A question on screen still outranks+the grace — a CLI that answers a submit with a permission prompt needs the+user, not a spinner — and the grace lives in :func:`observed` rather than in+:func:`read_activity` on purpose: the notification sweep keeps the strict+movement rule, or a prompt an agent swallowed would ring the bell "finished"+ten seconds after nothing happened.+## Honest limitsAn agent whose process WEDGES stops repainting, so it reads as finished a few@@ -371,6 +392,15 @@ def is_settled(activity: str) -> bool:#: module docstring.STAMP_FRESH_S = 6.0+#: How long a fresh submission may claim ``working`` before movement confirms.+#:+#: Long enough to cover the slowest observed gap between a submit and the+#: agent's first paint, short enough that a prompt an agent truly swallowed+#: goes back to telling the truth within one glance at the list. Applied only+#: on top of a ``waiting`` reading and only for a submission stamped for the+#: LIVE process — see the module docstring.+SUBMIT_GRACE_S = 10.0+class Reading(NamedTuple):"""What a pane is doing, and when it started doing it.@@ -410,20 +440,40 @@ def stamp(term: Any, activity: Activity, *, now: float) -> None:term.activity_at = now+def _submit_graced(term: Any, reading: Reading, moment: float) -> Reading:+ """``working`` for the first seconds after a submit, before movement shows.++ Upgrades only a ``waiting`` reading, so a question on screen keeps saying+ "needs you" and a broken or exited pane keeps saying so. ``since`` is the+ submit stamp — the honest moment this working episode began.+ """+ if reading.activity != "waiting":+ return reading+ if not _has_current_instruction(term):+ 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++def observed(term: Any, *, now: float | None = None) -> Reading:"""What ``term`` is doing, for a caller with no history of its own.The sweep's reading while there is a fresh one, and a single-look answer- otherwise. Duck-typed like the rest of this module: a pane that has never- been stamped answers from the look, not with an ``AttributeError``.+ otherwise — either way graced for a just-submitted pane (see the module+ docstring: the sweep's strict movement rule goes blind for a few seconds+ at exactly the moment the user has just pressed Send). Duck-typed like the+ rest of this module: a pane that has never been stamped answers from the+ look, not with an ``AttributeError``."""moment = time.time() if now is None else nowword = str(getattr(term, "activity", "") or "")at = float(getattr(term, "activity_at", 0.0) or 0.0)if word and 0 <= moment - at <= STAMP_FRESH_S:since = float(getattr(term, "activity_since", 0.0) or 0.0)- return Reading(word, since) # type: ignore[arg-type]- return Reading(read_activity(term, now=moment), 0.0)+ return _submit_graced(term, Reading(word, since), moment) # type: ignore[arg-type]+ return _submit_graced(term, Reading(read_activity(term, now=moment), 0.0), moment)def has_work_behind_it(term: Any) -> bool:@@ -475,6 +525,7 @@ __all__ = ["SETTLED","STAMP_FRESH_S","STILL_S",+ "SUBMIT_GRACE_S","TAIL_ROWS","Activity","Reading",diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsxindex 1b290987e7..72311ce1a9 100644--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx@@ -965,10 +965,13 @@ export function AgenticGrid({const since = live?.activity_since ?? row?.activity_since ?? term.activity_since ?? 0;const worked = live?.worked ?? row?.worked ?? term.worked ?? false;const sent = sentAt[term.name];+ // Never over "asking": a CLI that answers a submit with a permission+ // prompt needs the user, and a spinner over that question would promise+ // progress from a pane that is stuck on them.const bridging =sent !== undefined &&Date.now() - sent < SENT_BRIDGE_MS &&- (activity === "waiting" || activity === "asking" || activity === "");+ (activity === "waiting" || activity === "");if (bridging) {return { activity: "working" as const, since: sent / 1000, worked: true };}diff --git a/tests/unit/agentic_ide/test_pane_activity_status.py b/tests/unit/agentic_ide/test_pane_activity_status.pyindex 40295d3d80..bdd627c00b 100644--- a/tests/unit/agentic_ide/test_pane_activity_status.py+++ b/tests/unit/agentic_ide/test_pane_activity_status.py@@ -25,6 +25,7 @@ from typing import Anyimport pytest+from jarvis.agentic_ide import activity as activity_modfrom jarvis.agentic_ide import notificationsfrom jarvis.agentic_ide import session as session_modfrom jarvis.agentic_ide.activity import RESIZE_SHADOW_S, STAMP_FRESH_S, observed@@ -216,9 +217,7 @@ async def test_output_after_the_resize_shadow_still_counts_as_working(assert term.to_dict()["activity"] == "working"-async def test_a_grid_relayout_stamps_the_resize_shadow(- registry: Registry, tmp_path: Path-) -> None:+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@@ -381,6 +380,86 @@ async def test_the_caption_says_working_when_it_is(registry: Registry, tmp_path:assert "Working now" in state["recap_detail"]+# ----------------------------------------------------- the moment after Send+++async def test_a_just_submitted_pane_reads_as_working_before_it_paints(+ registry: Registry, tmp_path: Path+) -> None:+ """The blind window the maintainer kept hitting: Send, then a "done" badge.++ Movement proves work, but the agent's first byte can be seconds away and+ movement in the shadow of the submitting keystroke is discounted — so the+ seconds right after a submit read as "waiting" under the user's own just-+ pressed Send. The submission stamp is evidence enough for those seconds.+ """+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed(REST_SCREENS["claude"])+ _watched(registry, term, moves=False)+ assert term.to_dict()["activity"] == "waiting"++ _instruct(term, time.time())++ state = term.to_dict()+ assert state["activity"] == "working"+ # The episode began at the submit, not at the epoch — the tooltip's "For 2s".+ assert state["activity_since"] > 0+++async def test_the_submit_grace_expires_into_the_truth(registry: Registry, tmp_path: Path) -> None:+ """A prompt the agent swallowed stops claiming work within one glance."""+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed(REST_SCREENS["claude"])+ _instruct(term, time.time() - activity_mod.SUBMIT_GRACE_S - 1)+ _watched(registry, term, moves=False)++ assert term.to_dict()["activity"] == "waiting"+++async def test_a_question_on_screen_outranks_the_submit_grace(+ registry: Registry, tmp_path: Path+) -> None:+ """A CLI that answers a submit with a permission prompt needs the USER.++ Hiding that behind a grace-period spinner would be the worst of both: the+ pane sits on a question while its badge promises progress.+ """+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed("\r\nDo you want to allow this command? (y/n)\r\n")+ _watched(registry, term, moves=False)+ _instruct(term, time.time())++ assert term.to_dict()["activity"] == "asking"+++async def test_a_submit_to_a_replaced_process_earns_no_grace(+ registry: Registry, tmp_path: Path+) -> None:+ """Only the LIVE process's submission counts, exactly as for movement."""+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed(REST_SCREENS["claude"])+ _instruct(term, time.time())+ term.process_generation += 1 # the agent was respawned since that Send+ _watched(registry, term, moves=False)++ assert term.to_dict()["activity"] == "waiting"+++async def test_the_bell_keeps_the_strict_movement_rule(registry: Registry, tmp_path: Path) -> None:+ """The grace lives in `observed`, never in the sweep's own reading.++ Otherwise a swallowed prompt would count as a working episode, and its+ grace expiring would file a "finished" bell for a pane that did nothing.+ """+ _session, term = await _pane(registry, tmp_path)+ term.transcript.feed(REST_SCREENS["claude"])+ _instruct(term, time.time())++ reading = activity_mod.read_activity(term, now=time.time())++ assert reading == "waiting"++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.