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
feat(agentic-ide): settle a pane's title once its purpose has been read
rubenluetke10-beep559e002c26ef
diff --git a/jarvis/agentic_ide/recap_engine.py b/jarvis/agentic_ide/recap_engine.pyindex 82d7f4d24b..3529206094 100644--- a/jarvis/agentic_ide/recap_engine.py+++ b/jarvis/agentic_ide/recap_engine.py@@ -19,10 +19,12 @@ fallback rather than as the product:* **Cached, never on the read path.** ``recap_for`` returns whatever is alreadyknown — a model recap when one has arrived, the deterministic one until then —and returns it immediately. The model call happens in a background task.-* **Refreshed only on a material change.** A pane is re-summarized when it has- printed a few new lines, changed status, or been given a new instruction, and- at most once per :data:`MIN_REFRESH_S`. A grid that nobody has touched costs- nothing at all.+* **Refreshed only on a material change, then SETTLED.** A young pane is+ re-summarized as output arrives (at most once per :data:`MIN_REFRESH_S`), but+ once a summary has read a substantial transcript the title stays put: only a+ new instruction or a status change rewrites it (:data:`STABLE_AFTER_LINES`).+ A navigation label that re-words itself while the user glances away cannot be+ recognized again — and a grid that nobody has touched costs nothing at all.* **Bounded.** At most :data:`MAX_CONCURRENT` summaries are in flight across thewhole app, each with its own timeout, and a pane whose summaries keep failinggoes quiet for a while instead of retrying every poll.@@ -77,6 +79,18 @@ MIN_REFRESH_S = 75.0#: summary would spend a model call to write the same sentence again.MIN_NEW_LINES = 5+#: Once a summary was written from a transcript at least this many readable+#: rows deep, the pane's PURPOSE was visible and the title is settled: output+#: growth alone no longer triggers a rewrite, only a new instruction or a+#: status change does. This is what every conversation UI the user knows does —+#: a title names the session and then stays put, while "what is happening right+#: now" lives in the activity badge next to it. A label that re-words itself+#: every 75 seconds cannot be recognized, which is a navigation label's one+#: job. Summaries written EARLIER than this (a pane summarized at its first+#: eight rows knows the banner, not the work) may still improve with output+#: until one of them has seen this much.+STABLE_AFTER_LINES = 60+#: How much readable output a pane needs before a summary is worth asking for.#: A pane that has printed a banner and a prompt box has nothing to summarize;#: the deterministic recap already says so accurately.@@ -385,13 +399,24 @@ def _ui_language() -> str:def _material_change(term: Any, entry: _PaneState, line_count: int) -> bool:- """Has enough happened in this pane to be worth re-summarizing?"""+ """Has enough happened in this pane to be worth re-summarizing?++ Deliberately NOT "has it printed more" once the title has settled: progress+ changes what a pane has achieved, never what it is for, and the header is a+ navigation label. After a summary written from a substantial transcript+ (:data:`STABLE_AFTER_LINES`), only the events that can change the pane's+ purpose reopen it — a new instruction, or a status change (the final+ summary of a pane that just exited). The manual Refresh button bypasses+ this whole gate, as it always has.+ """if entry.generated_at <= 0.0:return Trueif str(getattr(term, "status", "") or "") != entry.status_at:return Trueif int(getattr(term, "prompts_sent", 0) or 0) != entry.prompts_at:return True+ if entry.lines_at >= STABLE_AFTER_LINES:+ return Falsereturn line_count - entry.lines_at >= MIN_NEW_LINES@@ -1031,6 +1056,7 @@ __all__ = ["MAX_EDIT_HEADLINE","MIN_NEW_LINES","MIN_REFRESH_S",+ "STABLE_AFTER_LINES","NO_PROVIDER_NOTE","WHY_DISABLED","WHY_NOT_STARTED",diff --git a/tests/unit/agentic_ide/test_recap_engine.py b/tests/unit/agentic_ide/test_recap_engine.pyindex cbf0f57297..98f550f531 100644--- a/tests/unit/agentic_ide/test_recap_engine.py+++ b/tests/unit/agentic_ide/test_recap_engine.py@@ -139,6 +139,52 @@ def test_a_pane_that_could_not_start_is_left_to_the_rules() -> None:assert not recap_engine._worth_summarizing(term, 30) # noqa: SLF001+def test_a_settled_title_ignores_output_growth() -> None:+ """A navigation label names the session and stays put — like every chat UI+ the user knows. Progress changes what a pane has ACHIEVED, never what it is+ for, so once a summary has read a substantial transcript, more output alone+ must not re-word the header the user navigates by."""+ term = _pane(lines=0)+ state = recap_engine._state(term.key) # noqa: SLF001+ state.generated_at = time.time() - 2 * recap_engine.MIN_REFRESH_S+ state.lines_at = recap_engine.STABLE_AFTER_LINES+ state.prompts_at = 0+ state.status_at = "live"++ grown = state.lines_at + 10 * recap_engine.MIN_NEW_LINES+ assert not recap_engine._material_change(term, state, grown) # noqa: SLF001+++def test_an_early_thin_summary_may_still_improve_with_output() -> None:+ """A pane summarized at its first rows knows the banner, not the work."""+ term = _pane(lines=0)+ state = recap_engine._state(term.key) # noqa: SLF001+ state.generated_at = time.time() - 2 * recap_engine.MIN_REFRESH_S+ state.lines_at = 10+ state.prompts_at = 0+ state.status_at = "live"++ assert recap_engine._material_change( # noqa: SLF001+ term, state, 10 + recap_engine.MIN_NEW_LINES+ )+++def test_a_settled_title_still_reopens_for_a_new_instruction_or_exit() -> None:+ """The two events that CAN change what a pane is for."""+ term = _pane(lines=0, prompts_sent=2)+ state = recap_engine._state(term.key) # noqa: SLF001+ state.generated_at = time.time()+ state.lines_at = recap_engine.STABLE_AFTER_LINES+ state.prompts_at = 1+ state.status_at = "live"++ assert recap_engine._material_change(term, state, state.lines_at) # noqa: SLF001++ state.prompts_at = 2+ term.status = "exited"+ assert recap_engine._material_change(term, state, state.lines_at) # noqa: SLF001++def test_a_new_instruction_makes_a_pane_worth_re_reading() -> None:term = _pane(lines=30, prompts_sent=2)state = recap_engine._state(term.key) # noqa: SLF001