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(agentic-ide): report a resumed pane as waiting again, not as busy

Ruben Lütke5ec1927c4ec3
diff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.py
index ab95384621..d6a695f143 100644
--- a/jarvis/agentic_ide/session.py
+++ b/jarvis/agentic_ide/session.py
@@ -2501,7 +2501,15 @@ class Registry:
term.error = ""
term.exit_code = None
term.started_at = time.time()
- term.last_output_at = time.time()
+ # No output has arrived from THIS process yet, and saying otherwise is
+ # not a harmless placeholder: `activity.read_activity` falls back to
+ # "bytes arrived recently" when it has no previous screen to compare
+ # against, so a start-stamp claims the pane is working the instant it
+ # goes live. A resumed pane was then never reported as waiting to be
+ # continued, because it looked busy from the moment it came back.
+ # Cleared rather than left alone so a restarted pane cannot inherit the
+ # previous process's last output either.
+ term.last_output_at = None
if term.resume is None and can_resume(term.agent):
# A CLI that cannot be told its session id (Codex): find out which
# one it just created, shortly from now.
diff --git a/tests/unit/agentic_ide/test_interrupted.py b/tests/unit/agentic_ide/test_interrupted.py
index 2b23265bc2..9f2ada7f91 100644
--- a/tests/unit/agentic_ide/test_interrupted.py
+++ b/tests/unit/agentic_ide/test_interrupted.py
@@ -14,12 +14,13 @@ a false one offers to type "continue" behind a prompt the user is still writing.
from __future__ import annotations
import asyncio
+import time
from pathlib import Path
from typing import Any
import pytest
-from jarvis.agentic_ide import interrupted, resume_store
+from jarvis.agentic_ide import activity, interrupted, resume_store
from jarvis.agentic_ide import session as session_mod
from jarvis.agentic_ide.agent_sessions import ResumeHandle
from jarvis.agentic_ide.session import Registry
@@ -122,23 +123,33 @@ async def test_a_finished_conversation_is_not_called_interrupted(
assert interrupted.scan(registry) == []
- "screen",
- [
- "\r\nCooking (12s · esc to interrupt)\r\n",
- "\r\nDo you want to continue?\r\n❯ 1. Yes\r\n",
- ],
-)
-async def test_a_resumed_pane_already_working_or_asking_is_not_offered_continue(
- registry: Registry,
- tmp_path: Path,
- existing_conversation: Any,
- screen: str,
+async def test_a_resumed_pane_already_working_is_not_offered_continue(
+ registry: Registry, tmp_path: Path, existing_conversation: Any
) -> None:
- """Active work needs no nudge; a question needs an answer, not a nudge."""
+ """Active work needs no nudge.
+
+ "Working" is a moving screen, not a phrase — `activity` deliberately stopped
+ reading what the CLI prints, so this drives the property it does read. Faking
+ it with a status line here would test a rule the product no longer has, and
+ would keep passing after that rule broke.
+ """
+ _session, term = await _restarted_pane(registry, tmp_path, existing_conversation)
+ term.last_output_at = time.time()
+
+ assert interrupted.scan(registry) == []
+
+
+async def test_a_resumed_pane_asking_a_question_is_not_offered_continue(
+ registry: Registry, tmp_path: Path, existing_conversation: Any
+) -> None:
+ """A question needs an answer, not a blind "continue".
+
+ The one place content is still consulted, and only ever to make a settled
+ pane MORE specific — so this one does belong on the screen.
+ """
_session, term = await _restarted_pane(registry, tmp_path, existing_conversation)
term.transcript.clear()
- term.transcript.feed(screen)
+ term.transcript.feed("\r\nDo you want to continue?\r\n❯ 1. Yes\r\n")
assert interrupted.scan(registry) == []
@@ -256,6 +267,10 @@ async def test_a_pane_that_never_submitted_is_reported_separately(
# Make the screen look like the input line kept the text.
on_output = fake_pty.spawns[-1]["on_output"]
await on_output("pty", f"\x1b[2J\x1b[H❯ {interrupted.CONTINUE_PROMPT}\r\n")
+ # That write is what a pane RECEIVING this screen does, and it stamps the
+ # pane as having just moved. The state under test is the one after it came
+ # to rest: the text is sitting on the input line and nothing else happens.
+ term.last_output_at = time.time() - activity.STILL_S - 1
report = await interrupted.continue_panes(registry)