Session tree structure with id/parentId linking
- Add TreeNode base type with id, parentId, timestamp - Add *Content types for clean input/output separation - Entry types are now TreeNode & *Content intersections - SessionManager assigns id/parentId on save, tracks leafId - Add migrateSessionEntries() for v1 to v2 conversion - Migration runs on load, rewrites file - buildSessionContext() uses tree traversal from leaf - Compaction returns CompactionResult (content only) - Hooks return compaction content, not full entries - Add firstKeptEntryId to before_compact hook event - Update mom package for tree fields - Better error messages for compaction failures
This commit is contained in:
@@ -156,9 +156,9 @@ describe.skipIf(!API_KEY)("AgentSession compaction e2e", () => {
|
||||
expect(compaction.type).toBe("compaction");
|
||||
if (compaction.type === "compaction") {
|
||||
expect(compaction.summary.length).toBeGreaterThan(0);
|
||||
// firstKeptEntryIndex can be 0 if all messages fit within keepRecentTokens
|
||||
// firstKeptEntryId can be 0 if all messages fit within keepRecentTokens
|
||||
// (which is the case for small conversations)
|
||||
expect(compaction.firstKeptEntryIndex).toBeGreaterThanOrEqual(0);
|
||||
expect(compaction.firstKeptEntryId).toBeGreaterThanOrEqual(0);
|
||||
expect(compaction.tokensBefore).toBeGreaterThan(0);
|
||||
}
|
||||
}, 120000);
|
||||
|
||||
Reference in New Issue
Block a user