From 2500f4ee5604ac4e5ec4f1a7505fe83fa5433ffb Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Tue, 15 Sep 2026 03:38:37 -0700 Subject: [PATCH] test(cli): sessions open-failure test creates the store so the read-only empty path does not short-circuit --- tests/hermes_cli/test_ux_messages_chat_sessions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/hermes_cli/test_ux_messages_chat_sessions.py b/tests/hermes_cli/test_ux_messages_chat_sessions.py index cd2813d3cf..2f1f431168 100644 --- a/tests/hermes_cli/test_ux_messages_chat_sessions.py +++ b/tests/hermes_cli/test_ux_messages_chat_sessions.py @@ -105,6 +105,12 @@ def test_sessions_db_open_failure_points_to_repair(monkeypatch, capsys): raise RuntimeError("database disk image is malformed") monkeypatch.setattr("hermes_state.SessionDB", _Boom) + import hermes_state + # `list` is read-only: a missing store prints "empty" instead; make the file exist so the + # open failure is the real corrupt-database case this copy is for. + db_path = hermes_state._default_db_path() + db_path.parent.mkdir(parents=True, exist_ok=True) + db_path.write_bytes(b"not a database") import argparse parser = argparse.ArgumentParser() args = argparse.Namespace(sessions_action="list", session_id=None)