Skip to content

The agent that grows with you

test(sessions): read the JSONL backup BOM-tolerantly in the round-trip test

kshitijk4poor8b608963238b
diff --git a/tests/hermes_cli/test_sessions_export_backup_round_trip.py b/tests/hermes_cli/test_sessions_export_backup_round_trip.py
index b708bb91855..76edb83008a 100644
--- a/tests/hermes_cli/test_sessions_export_backup_round_trip.py
+++ b/tests/hermes_cli/test_sessions_export_backup_round_trip.py
@@ -48,7 +48,7 @@ def test_jsonl_backup_round_trips_compaction_archived_turns(tmp_path, monkeypatc
dst = SessionDB(db_path=tmp_path / "restored.db")
try:
- payload = [json.loads(line) for line in backup.read_text(encoding="utf-8").splitlines() if line]
+ payload = [json.loads(line) for line in backup.read_text(encoding="utf-8-sig").splitlines() if line]
assert dst.import_sessions(payload)["ok"]
assert _shape(dst, include_compacted=True) == shown, "display history must survive the backup"
assert _shape(dst) == live, "archived turns must not come back as live context"