File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -771,6 +771,25 @@ def test_file_history_snapshot_timestamp(self):
771771 finally :
772772 os .unlink (path )
773773
774+ def test_summary_entry_type_produces_no_message (self , caplog ):
775+ path = _write_jsonl (
776+ [
777+ {
778+ "type" : "summary" ,
779+ "timestamp" : "2026-01-03T08:00:00Z" ,
780+ "summary" : "Session recap metadata" ,
781+ },
782+ ]
783+ )
784+ try :
785+ with caplog .at_level ("WARNING" , logger = "utils.jsonl_parser" ):
786+ s = parse_session (path )
787+ assert len (s ["messages" ]) == 0
788+ assert s ["metadata" ]["entry_counts" ].get ("summary" ) == 1
789+ assert "Unknown message role" not in caplog .text
790+ finally :
791+ os .unlink (path )
792+
774793 def test_entry_counts_accumulated (self ):
775794 assistant_entry = {
776795 "type" : "assistant" ,
Original file line number Diff line number Diff line change 4141 "_track_file_activity" ,
4242]
4343
44- _SKIP_ENTRY_TYPES = frozenset ({"file-history-snapshot" })
44+ # Metadata-only JSONL entry types: contribute timestamps/counts but not messages.
45+ _SKIP_ENTRY_TYPES = frozenset ({"file-history-snapshot" , "summary" })
4546_VALID_ROLES = frozenset (get_args (RoleLiteral ))
4647_log = logging .getLogger (__name__ )
4748
You can’t perform that action at this time.
0 commit comments