Skip to content

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.

fix(ide): read agents resumed mid-turn as working

rubenluetke10-beepe215ba95e4bf
diff --git a/jarvis/agentic_ide/activity.py b/jarvis/agentic_ide/activity.py
index 1797b24ade..53a7fdd8fa 100644
--- a/jarvis/agentic_ide/activity.py
+++ b/jarvis/agentic_ide/activity.py
@@ -353,7 +353,9 @@ def _adopted_with_work(term: Any) -> bool:
its instruction in the previous app's lifetime, so no submit stamp of THIS
app can prove it. ``Session._adopt_hosted`` records the proof it had then
(a conversation on disk, prompts sent, work seen at the last checkpoint) as
- ``adopted_generation``; it holds only for that very process.
+ ``adopted_generation``; it holds only for that very process. A process
+ resumed to finish a turn cut off mid-work carries the same proof: it goes
+ on with the old job by itself, with nothing submitted in this lifetime.
"""
try:
return int(getattr(term, "adopted_generation", -1)) == int(
diff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.py
index c18579cce0..17e9a3c619 100644
--- a/jarvis/agentic_ide/session.py
+++ b/jarvis/agentic_ide/session.py
@@ -1215,7 +1215,10 @@ class Terminal:
# the last checkpoint. The instruction behind that job was submitted in the
# previous app's lifetime, so ``submit_generation`` cannot prove it; this
# does, for exactly this process (a respawn moves the generation on).
- # Without it every re-joined agent read "done" while still working.
+ # Without it every re-joined agent read "done" while still working. The
+ # same proof is stamped on a process RESUMED to finish a turn that was cut
+ # off mid-work (``agent_sessions.resume_env``): it carries on by itself, so
+ # no submit in this lifetime exists either.
adopted_generation: int = -1
transcript: Transcript = field(default_factory=Transcript)
# The RAW output stream, kept so the next viewer can be handed the screen
@@ -4139,6 +4142,12 @@ class Registry:
if native:
base = env if env is not None else _without_parent_agent_session(dict(os.environ))
env = {**(base if base is not None else os.environ), **native}
+ if term.resume_continuation_needed:
+ # The turn it re-runs is the job the user handed over before
+ # the process died. Nothing is submitted in THIS lifetime, so
+ # without this proof the agent worked on while every list
+ # filed it under "done" (maintainer report 2026-09-29).
+ term.adopted_generation = term.process_generation
# The provider/account gate is acquired BEFORE the machine-wide gate.
# A Codex pane waiting on shared state must never occupy a CPU slot that
diff --git a/tests/unit/agentic_ide/test_reboot_resume.py b/tests/unit/agentic_ide/test_reboot_resume.py
index e6bf54d55c..edad41dc7e 100644
--- a/tests/unit/agentic_ide/test_reboot_resume.py
+++ b/tests/unit/agentic_ide/test_reboot_resume.py
@@ -127,6 +127,34 @@ async def test_agents_carry_on_by_themselves_never_by_a_typed_continue(
assert nudged == []
+async def test_an_agent_resumed_mid_turn_reads_working_while_it_moves(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ """The re-run turn is the old job: movement counts as work, not as noise.
+
+ Nothing is submitted in this lifetime, so without the resume proof both
+ panes below read "waiting" forever — the Agents tab filed a pane rendering
+ a film under Done (maintainer report 2026-09-29). An agent that was idle
+ when it died gets no such proof: its redraws must not invent work.
+ """
+ from jarvis.agentic_ide.activity import read_activity
+
+ ws, _ = _save(tmp_path, [_pane(1, working=True), _pane(2)])
+ _store(ws)
+ pool = FakeHostedPool()
+
+ registry, _nudged = await _boot(monkeypatch, pool)
+ await _settle(pool, 2)
+
+ session = registry.sessions[0]
+ interrupted, idle = session.find("T1"), session.find("T2")
+ now = time.time()
+ for term in (interrupted, idle):
+ term.last_output_at = now
+ assert read_activity(interrupted, now=now) == "working"
+ assert read_activity(idle, now=now) == "waiting"
+
+
async def test_agents_that_ended_by_themselves_stay_ended(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None: