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.

test(agentic-ide): keep test runs out of the real recents file

Ruben Lütke54d76986aa99
diff --git a/tests/unit/agentic_ide/test_pane_batch.py b/tests/unit/agentic_ide/test_pane_batch.py
index 06045a2803..273b6252e6 100644
--- a/tests/unit/agentic_ide/test_pane_batch.py
+++ b/tests/unit/agentic_ide/test_pane_batch.py
@@ -22,6 +22,23 @@ from jarvis.agentic_ide.session import (
from tests.fakes.fake_pty_manager import FakePtyManager
[email protected](autouse=True)
+def _isolated_recents(tmp_path_factory: pytest.TempPathFactory, monkeypatch: pytest.MonkeyPatch) -> None:
+ """Keep the recents file out of the developer's real data directory.
+
+ Opening a workspace records it as "most recently used", and that file lives
+ under the per-user data dir — the SAME file the running app reads. Without
+ this, a test run rewrites the maintainer's recent-workspace list with
+ throwaway pytest folders (measured 2026-07-25: all eight entries were
+ ``pytest-of-…`` paths), and the voice path that opens "the most recent
+ workspace" then starts coding agents in a deleted temp directory.
+ """
+ from jarvis.agentic_ide import recents
+
+ store = tmp_path_factory.mktemp("recents") / "recents.json"
+ monkeypatch.setattr(recents, "_store_path", lambda: store)
+
+
@pytest.fixture
def registry(monkeypatch: pytest.MonkeyPatch) -> Registry:
monkeypatch.setattr(session_mod, "agent_argv", lambda name: (f"/usr/bin/{name}",))
diff --git a/tests/unit/brain/test_agentic_ide_spawn_fast_path.py b/tests/unit/brain/test_agentic_ide_spawn_fast_path.py
index df85d41441..c0b48b27f4 100644
--- a/tests/unit/brain/test_agentic_ide_spawn_fast_path.py
+++ b/tests/unit/brain/test_agentic_ide_spawn_fast_path.py
@@ -43,6 +43,23 @@ def _event_names(bus: FakeBus) -> list[str]:
return [type(e).__name__ for e in bus.published]
[email protected](autouse=True)
+def _isolated_recents(tmp_path_factory: pytest.TempPathFactory, monkeypatch: pytest.MonkeyPatch) -> None:
+ """Keep the recents file out of the developer's real data directory.
+
+ Opening a workspace records it as "most recently used", and that file lives
+ under the per-user data dir — the SAME file the running app reads. Without
+ this, a test run rewrites the maintainer's recent-workspace list with
+ throwaway pytest folders (measured 2026-07-25: all eight entries were
+ ``pytest-of-…`` paths), and the voice path that opens "the most recent
+ workspace" then starts coding agents in a deleted temp directory.
+ """
+ from jarvis.agentic_ide import recents
+
+ store = tmp_path_factory.mktemp("recents") / "recents.json"
+ monkeypatch.setattr(recents, "_store_path", lambda: store)
+
+
@pytest.fixture
def registry(monkeypatch: pytest.MonkeyPatch) -> Registry:
"""A real registry on a fake pseudo-terminal, wired in place of the global one."""