From 1484d96a4216c96a0554ca098d222bda1cd438cd Mon Sep 17 00:00:00 2001 From: Josh Lehman Date: Mon, 13 Apr 2026 09:26:16 -0700 Subject: [PATCH] test: stabilize context-engine loop hook coverage --- .../pi-embedded-runner/tool-result-context-guard.test.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/agents/pi-embedded-runner/tool-result-context-guard.test.ts b/src/agents/pi-embedded-runner/tool-result-context-guard.test.ts index b75e8aaa350..2c8f610e07a 100644 --- a/src/agents/pi-embedded-runner/tool-result-context-guard.test.ts +++ b/src/agents/pi-embedded-runner/tool-result-context-guard.test.ts @@ -495,12 +495,8 @@ describe("installContextEngineLoopHook", () => { await callTransform(agent, batch2); expect(engine.ingestBatch).toHaveBeenCalledTimes(2); - expect(engine.ingestBatch?.mock.calls[0]?.[0]).toMatchObject({ - messages: [makeUser("second"), makeToolResult("call_2", "r2")], - }); - expect(engine.ingestBatch?.mock.calls[1]?.[0]).toMatchObject({ - messages: [makeUser("third"), makeToolResult("call_3", "r3")], - }); + expect(engine.ingestBatch?.mock.calls[0]?.[0]?.messages).toEqual(batch1.slice(2)); + expect(engine.ingestBatch?.mock.calls[1]?.[0]?.messages).toEqual(batch2.slice(4)); expect(engine.assemble).toHaveBeenCalledTimes(2); });