File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -720,6 +720,25 @@ def test_file_history_snapshot_timestamp(self):
720720 finally :
721721 os .unlink (path )
722722
723+ def test_summary_entry_type_produces_no_message (self , caplog ):
724+ path = _write_jsonl (
725+ [
726+ {
727+ "type" : "summary" ,
728+ "timestamp" : "2026-01-03T08:00:00Z" ,
729+ "summary" : "Session recap metadata" ,
730+ },
731+ ]
732+ )
733+ try :
734+ with caplog .at_level ("WARNING" , logger = "utils.jsonl_parser" ):
735+ s = parse_session (path )
736+ assert len (s ["messages" ]) == 0
737+ assert s ["metadata" ]["entry_counts" ].get ("summary" ) == 1
738+ assert "Unknown message role" not in caplog .text
739+ finally :
740+ os .unlink (path )
741+
723742 def test_entry_counts_accumulated (self ):
724743 assistant_entry = {
725744 "type" : "assistant" ,
Original file line number Diff line number Diff line change 2424
2525__all__ = ["parse_session" , "quick_session_info" ]
2626
27- _SKIP_ENTRY_TYPES = frozenset ({"file-history-snapshot" })
27+ # Metadata-only JSONL entry types: contribute timestamps/counts but not messages.
28+ _SKIP_ENTRY_TYPES = frozenset ({"file-history-snapshot" , "summary" })
2829_VALID_ROLES = frozenset (get_args (RoleLiteral ))
2930_log = logging .getLogger (__name__ )
3031
You can’t perform that action at this time.
0 commit comments