The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix: export sessions without mutating canonical storage
Tekniumae82c1a2d0cc
diff --git a/hermes_cli/sessions_cmd.py b/hermes_cli/sessions_cmd.pyindex 8c2311fe9a3..cb000646b85 100644--- a/hermes_cli/sessions_cmd.py+++ b/hermes_cli/sessions_cmd.py@@ -957,6 +957,7 @@ def cmd_sessions(args, sessions_parser=None):from hermes_constants import get_hermes_homepath = get_hermes_home() / "state.db"empty_messages = {+ "export": "No sessions found.","list": "No sessions found.","stats": "Total sessions: 0\nTotal messages: 0","pinned": "[]" if getattr(args, "json", False) elsediff --git a/tests/hermes_cli/test_sessions_observation.py b/tests/hermes_cli/test_sessions_observation.pyindex daf85a69802..7bc20dc8675 100644--- a/tests/hermes_cli/test_sessions_observation.py+++ b/tests/hermes_cli/test_sessions_observation.py@@ -26,10 +26,11 @@ if POPULATED:db.create_session('observation-fixture', source='cli')db.append_message('observation-fixture', role='user', content='fixture')before = path.read_bytes() if path.exists() else None-for action in ('list', 'stats', 'pinned'):+for action in ('list', 'stats', 'pinned', 'export'):output = io.StringIO()with redirect_stdout(output):- result = cmd_sessions(SimpleNamespace(sessions_action=action, source=None, limit=20, json=True))+ result = cmd_sessions(SimpleNamespace(sessions_action=action, source=None, limit=20, json=True,+ session_id=None, redact=False, format='jsonl', output='-', dry_run=False))text = output.getvalue()assert result in (None, 0), textassert 'Error:' not in text, text@@ -39,6 +40,8 @@ for action in ('list', 'stats', 'pinned'):assert ('Total sessions: 1' if POPULATED else 'Total sessions: 0') in text, textif action == 'pinned':assert text.strip() == '[]', text+ if action == 'export':+ assert ('observation-fixture' if POPULATED else 'No sessions found.') in text, textafter = path.read_bytes() if path.exists() else Noneassert after == before, action + ' created or mutated state.db''''.replace('POPULATED', repr(populated))