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(ide): key pane recaps by lifetime id so same-named panes keep their own titles
rubenluetke10-beep8c9ab93b2e69
diff --git a/jarvis/agentic_ide/recap_engine.py b/jarvis/agentic_ide/recap_engine.pyindex d391295db3..91f3bb67a9 100644--- a/jarvis/agentic_ide/recap_engine.py+++ b/jarvis/agentic_ide/recap_engine.py@@ -450,6 +450,18 @@ def describe_failure(exc: BaseException) -> str:return recap.condense(raw, 200)+def pane_id(term: Any) -> str:+ """The id this module remembers a pane under: its LIFETIME id, never its key.++ A pane key ("t5") is unique only inside one workspace, and two open+ workspaces each hold a T5. Keyed by it, both panes shared one cache entry,+ so one pane's header showed the other pane's model-written title+ (maintainer report 2026-09-29). ``history_id`` is minted once per pane and+ never handed on; the key is only the fallback for an object without one.+ """+ return str(getattr(term, "history_id", "") or getattr(term, "key", "") or "")++def _state(key: str) -> _PaneState:entry = _panes.get(key)if entry is None:@@ -554,7 +566,7 @@ def recap_for(term: Any, *, lines: Sequence[str] | None = None) -> SmartRecap:been written, and the deterministic one until then — so a pane always has aheader, from the moment it opens."""- entry = _panes.get(str(getattr(term, "key", "") or ""))+ entry = _panes.get(pane_id(term))if entry is not None and entry.pinned_headline:return SmartRecap(headline=entry.pinned_headline,@@ -579,7 +591,7 @@ def recap_for(term: Any, *, lines: Sequence[str] | None = None) -> SmartRecap:# that names the work. A state label ("running since 10:52") is true for# this poll and must not be what the list keeps saying once the pane has# been asked something.- key = str(getattr(term, "key", "") or "")+ key = pane_id(term)if key:state = _state(key)state.floor_headline = plain.headline if plain.names_work else ""@@ -612,7 +624,7 @@ def known_headline(term: Any) -> str:been asked nothing anywhere; the list then names the CLI, which is then infact everything there is to say."""- entry = _panes.get(str(getattr(term, "key", "") or ""))+ entry = _panes.get(pane_id(term))if entry is not None:if entry.pinned_headline:return entry.pinned_headline@@ -638,7 +650,7 @@ def refresh_soon(term: Any, *, lines: Sequence[str], folder: str = "") -> None:try:if not _enabled():return- key = str(getattr(term, "key", "") or "")+ key = pane_id(term)if not key:returnrows = list(lines)@@ -1210,7 +1222,7 @@ async def summarize_now(term: Any, *, lines: Sequence[str], folder: str = "") ->as the deterministic recap plus a note saying exactly that, because "why isthis line thin" is the question the whole feature exists to answer."""- key = str(getattr(term, "key", "") or "")+ key = pane_id(term)entry = _state(key) if key else _PaneState()unpin(key)rows = list(lines)diff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.pyindex 5892c3567b..0f5c7f770c 100644--- a/jarvis/agentic_ide/session.py+++ b/jarvis/agentic_ide/session.py@@ -5888,7 +5888,7 @@ class Registry:# The recap cache is keyed by pane, and pane keys are reused# (a new "Mika" in the same workspace). Dropping it here is what# stops a fresh pane opening under the last one's sentence.- recap_engine.forget(term.key)+ recap_engine.forget(recap_engine.pane_id(term))opening.forget(term.key)# Its bell entries go the same way and for the same reason.# Each one is a "jump to this pane" button, and the pane hasdiff --git a/jarvis/ui/web/agentic_ide_routes.py b/jarvis/ui/web/agentic_ide_routes.pyindex c5325b2afa..0e4fee8ff8 100644--- a/jarvis/ui/web/agentic_ide_routes.py+++ b/jarvis/ui/web/agentic_ide_routes.py@@ -3187,7 +3187,7 @@ def set_terminal_recap(it plainly means."""term, _session = _pane_for_recap(name, workspace_id)- summary = recap_engine.pin(term.key, payload.recap, payload.recap_detail)+ summary = recap_engine.pin(recap_engine.pane_id(term), payload.recap, payload.recap_detail)if not summary.headline:# Cleared rather than written: answer with whatever the pane says now.summary = recap_engine.recap_for(term, lines=term.transcript.lines())@@ -3207,7 +3207,7 @@ def clear_terminal_recap(name: str, workspace_id: str | None = None) -> Terminalwindow."""term, _session = _pane_for_recap(name, workspace_id)- recap_engine.unpin(term.key)+ recap_engine.unpin(recap_engine.pane_id(term))return _recap_row(term, recap_engine.recap_for(term, lines=term.transcript.lines()))diff --git a/tests/unit/agentic_ide/test_recap_engine.py b/tests/unit/agentic_ide/test_recap_engine.pyindex 04e8bbfea4..d90e7c869d 100644--- a/tests/unit/agentic_ide/test_recap_engine.py+++ b/tests/unit/agentic_ide/test_recap_engine.py@@ -61,7 +61,7 @@ def test_a_pane_with_no_summary_yet_still_has_a_recap() -> None:def test_a_summarized_pane_reports_the_model_sentence() -> None:term = _pane(lines=3)- state = recap_engine._state(term.key) # noqa: SLF001 - the cache under test+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001 - the cache under teststate.headline = "Wrote the swap analysis, not committed"state.detail = "The document is at docs/plans/agentic-ide-terminal-swap.md."state.generated_at = time.time()@@ -75,13 +75,33 @@ def test_a_summarized_pane_reports_the_model_sentence() -> None:def test_a_closed_pane_forgets_its_recap() -> None:"""Pane keys are reused, so a new pane must not inherit the old sentence."""term = _pane()- recap_engine._state(term.key).headline = "Old news" # noqa: SLF001+ recap_engine._state(recap_engine.pane_id(term)).headline = "Old news" # noqa: SLF001- recap_engine.forget(term.key)+ recap_engine.forget(recap_engine.pane_id(term))assert recap_engine.recap_for(term, lines=[]).source == recap_engine.BY_RULES+def test_same_key_panes_in_two_workspaces_keep_their_own_titles() -> None:+ """Two open workspaces each hold a T5; one's title must not appear on the other."""+ here = _pane(lines=3, key="t5", last_prompt="Label the even-out button")+ there = _pane(lines=3, key="t5", last_prompt="Round Mission Control deck")+ assert here.history_id != there.history_id++ state = recap_engine._state(recap_engine.pane_id(there)) # noqa: SLF001+ state.headline = "Mission Control deck, modern screens"+ state.generated_at = time.time()++ assert recap_engine.recap_for(there, lines=[]).source == recap_engine.BY_MODEL+ assert recap_engine.recap_for(here, lines=here.transcript.lines()).source == (+ recap_engine.BY_RULES+ )+ assert "Mission Control" not in recap_engine.known_headline(here)++ recap_engine.pin(recap_engine.pane_id(here), "Button label")+ assert recap_engine.known_headline(there) == "Mission Control deck, modern screens"++# ------------------------------------------------------ the title from memory@@ -98,12 +118,12 @@ def test_the_known_headline_is_what_the_header_last_showed() -> None:assert recap_engine.known_headline(term) == shown.headlineassert "Fix the failing login test" in recap_engine.known_headline(term)- state = recap_engine._state(term.key) # noqa: SLF001 - the cache under test+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001 - the cache under teststate.headline = "Wrote the login fix, tests green"state.generated_at = time.time()assert recap_engine.known_headline(term) == "Wrote the login fix, tests green"- recap_engine.pin(term.key, "Login rework")+ recap_engine.pin(recap_engine.pane_id(term), "Login rework")assert recap_engine.known_headline(term) == "Login rework"@@ -197,7 +217,7 @@ def test_a_quiet_pane_is_not_summarized_again(monkeypatch) -> None:async def scenario() -> None:term = _pane(lines=30)rows = _rows(30)- state = recap_engine._state(term.key) # noqa: SLF001+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001state.headline = "Already known"state.generated_at = time.time()state.lines_at = len(rows)@@ -232,7 +252,7 @@ def test_a_settled_title_ignores_output_growth() -> None:for, so once a summary has read a substantial transcript, more output alonemust not re-word the header the user navigates by."""term = _pane(lines=0)- state = recap_engine._state(term.key) # noqa: SLF001+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001state.generated_at = time.time() - 2 * recap_engine.MIN_REFRESH_Sstate.lines_at = recap_engine.STABLE_AFTER_LINESstate.prompts_at = 0@@ -245,7 +265,7 @@ def test_a_settled_title_ignores_output_growth() -> None: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 = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001state.generated_at = time.time() - 2 * recap_engine.MIN_REFRESH_Sstate.lines_at = 10state.prompts_at = 0@@ -261,7 +281,7 @@ def test_a_hand_typed_instruction_reopens_a_settled_title() -> None:task into the pane stamps last_submit_at — and repurposing a pane by handmust reopen its title exactly like a sent instruction does."""term = _pane(lines=0, last_submit_at=200.0)- state = recap_engine._state(term.key) # noqa: SLF001+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001state.generated_at = time.time()state.lines_at = recap_engine.STABLE_AFTER_LINESstate.prompts_at = 0@@ -277,7 +297,7 @@ def test_a_hand_typed_instruction_reopens_a_settled_title() -> None: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 = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001state.generated_at = time.time()state.lines_at = recap_engine.STABLE_AFTER_LINESstate.prompts_at = 1@@ -292,7 +312,7 @@ def test_a_settled_title_still_reopens_for_a_new_instruction_or_exit() -> None: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+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001state.generated_at = time.time()state.lines_at = 30state.prompts_at = 1@@ -791,7 +811,7 @@ def test_a_failing_provider_leaves_the_previous_sentence_in_place() -> None:async def scenario() -> None:term = _pane(lines=40)- state = recap_engine._state(term.key) # noqa: SLF001+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001state.headline = "The sentence already on screen"state.inflight = True@@ -801,7 +821,7 @@ def test_a_failing_provider_leaves_the_previous_sentence_in_place() -> None:original = recap_engine.summarize_with_modelrecap_engine.summarize_with_model = explode # type: ignore[assignment]try:- await recap_engine._run(term, term.key, _rows(40), "") # noqa: SLF001+ await recap_engine._run(term, recap_engine.pane_id(term), _rows(40), "") # noqa: SLF001finally:recap_engine.summarize_with_model = original # type: ignore[assignment]@@ -817,7 +837,7 @@ def test_repeated_failures_stop_the_pane_asking_for_a_while() -> None:async def scenario() -> None:term = _pane(lines=40)- state = recap_engine._state(term.key) # noqa: SLF001+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001async def explode(*_args: object, **_kwargs: object) -> None:raise RuntimeError("no key")@@ -827,7 +847,7 @@ def test_repeated_failures_stop_the_pane_asking_for_a_while() -> None:try:for _ in range(recap_engine.FAILURES_BEFORE_QUIET):state.inflight = True- await recap_engine._run(term, term.key, _rows(40), "") # noqa: SLF001+ await recap_engine._run(term, recap_engine.pane_id(term), _rows(40), "") # noqa: SLF001finally:recap_engine.summarize_with_model = original # type: ignore[assignment]@@ -850,8 +870,8 @@ def test_a_successful_summary_becomes_the_pane_recap() -> None:original = recap_engine.summarize_with_modelrecap_engine.summarize_with_model = answer # type: ignore[assignment]try:- recap_engine._state(term.key).inflight = True # noqa: SLF001- await recap_engine._run(term, term.key, _rows(40), "") # noqa: SLF001+ recap_engine._state(recap_engine.pane_id(term)).inflight = True # noqa: SLF001+ await recap_engine._run(term, recap_engine.pane_id(term), _rows(40), "") # noqa: SLF001finally:recap_engine.summarize_with_model = original # type: ignore[assignment]@@ -860,7 +880,7 @@ def test_a_successful_summary_becomes_the_pane_recap() -> None:assert shown.source == recap_engine.BY_MODEL# And the pane is now considered summarized as of these rows, so the# next poll does not immediately ask again.- state = recap_engine._state(term.key) # noqa: SLF001+ state = recap_engine._state(recap_engine.pane_id(term)) # noqa: SLF001assert state.lines_at == 40assert state.prompts_at == 1