Fix SessionEntry type to exclude SessionHeader

- SessionEntry now only contains conversation entries (messages, compaction, etc.)
- SessionHeader is separate, not part of SessionEntry
- FileEntry = SessionHeader | SessionEntry (for file storage)
- getEntries() filters out header, returns SessionEntry[]
- Added getHeader() for accessing session metadata
- Updated compaction and tests to not expect header in entries
- Updated mom package to use FileEntry for internal storage
This commit is contained in:
Mario Zechner 2025-12-26 00:31:53 +01:00
parent 251fea752c
commit 9478a3c1f5
6 changed files with 50 additions and 75 deletions

View file

@ -759,7 +759,7 @@ export class AgentSession {
if (lastEntry?.type === "compaction") {
throw new Error("Already compacted");
}
throw new Error("Nothing to compact (session too small or needs migration)");
throw new Error("Nothing to compact (session too small)");
}
// Find previous compaction summary if any