From f8a2f048ccbbc27cf2909a3f9d810b2cc9f428f8 Mon Sep 17 00:00:00 2001 From: Kai Valo Date: Mon, 26 Jan 2026 16:35:41 +0000 Subject: [PATCH] test(memoryFlush): add tests for resetSession option --- src/auto-reply/reply/memory-flush.test.ts | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/auto-reply/reply/memory-flush.test.ts b/src/auto-reply/reply/memory-flush.test.ts index 6d04b21e3..9f2e9ad17 100644 --- a/src/auto-reply/reply/memory-flush.test.ts +++ b/src/auto-reply/reply/memory-flush.test.ts @@ -42,6 +42,41 @@ describe("memory flush settings", () => { expect(settings?.prompt).toContain("NO_REPLY"); expect(settings?.systemPrompt).toContain("NO_REPLY"); }); + + it("defaults resetSession to false", () => { + const settings = resolveMemoryFlushSettings(); + expect(settings?.resetSession).toBe(false); + }); + + it("respects resetSession when set to true", () => { + const settings = resolveMemoryFlushSettings({ + agents: { + defaults: { + compaction: { + memoryFlush: { + resetSession: true, + }, + }, + }, + }, + }); + expect(settings?.resetSession).toBe(true); + }); + + it("respects resetSession when explicitly set to false", () => { + const settings = resolveMemoryFlushSettings({ + agents: { + defaults: { + compaction: { + memoryFlush: { + resetSession: false, + }, + }, + }, + }, + }); + expect(settings?.resetSession).toBe(false); + }); }); describe("shouldRunMemoryFlush", () => {