Skip to content

The agent that grows with you

style(sessions): nested def for the /save json test shape helper

kshitijk4poor60477785b8a2
diff --git a/hermes_cli/session_export.py b/hermes_cli/session_export.py
index d3f00471730..8453260b22d 100644
--- a/hermes_cli/session_export.py
+++ b/hermes_cli/session_export.py
@@ -217,6 +217,7 @@ def export_projection(transcript: bool) -> Dict[str, bool]:
``import_sessions`` brings the flagged rows back archived, never as live context."""
return {"include_compacted": True} if transcript else {"include_inactive": True}
+
SAVE_USAGE = """/save — export the current session to a file
Usage: /save <format> [filename] [redact]
diff --git a/tests/hermes_cli/test_save_transcript_history.py b/tests/hermes_cli/test_save_transcript_history.py
index 84c495b3f2b..00a07cf0416 100644
--- a/tests/hermes_cli/test_save_transcript_history.py
+++ b/tests/hermes_cli/test_save_transcript_history.py
@@ -77,7 +77,10 @@ def test_save_json_restores_compacted_history_as_archived(tmp_path, monkeypatch,
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
db = _compacted_store(tmp_path / "state.db")
- shape = lambda store, **flags: [(m["role"], m["content"]) for m in store.get_messages("s1", **flags)] # noqa: E731
+
+ def shape(store, **flags):
+ return [(m["role"], m["content"]) for m in store.get_messages("s1", **flags)]
+
try:
shown, live = shape(db, include_compacted=True), shape(db)
snapshot = json.loads(save(db, "json", tmp_path / "saved.json"))