From 7558fed4e42440f3cde4f37cefbcaac6c32e1ed0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 14 Dec 2025 18:51:25 +0000 Subject: [PATCH 1/2] Initial plan From 202494156bf6b5846e3d3f2c1615d6f2bfac9975 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 14 Dec 2025 18:57:54 +0000 Subject: [PATCH 2/2] Fix test expectation for fs.readFile call count in agent-service.test.ts The test "should reuse existing session if already started" expected fs.readFile to be called 1 time, but startConversation calls it 2 times on first call (loadSession + loadMetadata). The second call correctly reuses the in-memory session. Co-authored-by: GTheMachine <156854865+GTheMachine@users.noreply.github.com> --- apps/server/tests/unit/services/agent-service.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/server/tests/unit/services/agent-service.test.ts b/apps/server/tests/unit/services/agent-service.test.ts index efe27fbf..8b953c7b 100644 --- a/apps/server/tests/unit/services/agent-service.test.ts +++ b/apps/server/tests/unit/services/agent-service.test.ts @@ -103,8 +103,9 @@ describe("agent-service.ts", () => { }); expect(result.success).toBe(true); - // Should only read file once - expect(fs.readFile).toHaveBeenCalledTimes(1); + // First call reads session file and metadata file (2 calls) + // Second call should reuse in-memory session (no additional calls) + expect(fs.readFile).toHaveBeenCalledTimes(2); }); });