Skip to content

The agent that grows with you

test: SessionDB doubles accept the read_only kwarg / registry acquire the CLI now uses

teknium1d4063e6260ce
diff --git a/tests/hermes_cli/test_resolve_last_session.py b/tests/hermes_cli/test_resolve_last_session.py
index 740ed79f8a1..2adabb52e27 100644
--- a/tests/hermes_cli/test_resolve_last_session.py
+++ b/tests/hermes_cli/test_resolve_last_session.py
@@ -131,5 +131,5 @@ def test_resolve_last_session_real_db_prefers_workspace(monkeypatch, tmp_path):
cmd, 0, stdout=str(repo_a), stderr=""
),
)
- monkeypatch.setattr("hermes_state.SessionDB", lambda: real_db(db_path=state_db))
+ monkeypatch.setattr("hermes_state.SessionDB", lambda **kw: real_db(db_path=state_db, **kw))
assert _resolve_last_session("cli") == "repo_a"
diff --git a/tests/hermes_cli/test_tui_resume_flow.py b/tests/hermes_cli/test_tui_resume_flow.py
index fe6ca2c8b43..e008ed43028 100644
--- a/tests/hermes_cli/test_tui_resume_flow.py
+++ b/tests/hermes_cli/test_tui_resume_flow.py
@@ -167,9 +167,8 @@ def test_oneshot_wires_session_db_for_recall(monkeypatch):
captured["prompt"] = prompt
return {"final_response": "ok", "failed": False, "partial": False}
- class FakeSessionDB:
- def __new__(cls):
- return sentinel_db
+ def fake_acquire(db_path=None):
+ return sentinel_db
def mod(name, **attrs):
module = types.ModuleType(name)
@@ -178,7 +177,8 @@ def test_oneshot_wires_session_db_for_recall(monkeypatch):
return module
monkeypatch.setitem(sys.modules, "run_agent", mod("run_agent", AIAgent=FakeAgent))
- monkeypatch.setitem(sys.modules, "hermes_state", mod("hermes_state", SessionDB=FakeSessionDB))
+ # Oneshot borrows the process-shared registry handle (one writer per state.db path).
+ monkeypatch.setitem(sys.modules, "hermes_state_registry", mod("hermes_state_registry", acquire=fake_acquire))
monkeypatch.setitem(
sys.modules,
"hermes_cli.config",