From 1c875f1704325d6afefc92a3f3556bc2090e72e4 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Tue, 9 Jun 2026 23:26:13 -0700 Subject: [PATCH] FN-6172: fix skill diagnostics logger assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the skill diagnostics test to assert against the structured logger surface that now emits the diagnostics output. - spy on piLog.log instead of piLog.warn in the structured logger diagnostics test - keep the existing [skills] and [executor] assertions while matching the current logging path Files changed: packages/engine/src/__tests__/pi-create-fn-agent.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Fusion-Task-Id: FN-6172 Fusion-Task-Lineage: e52023f7-6c18-435d-b2c6-bd7f7024b75f --- packages/engine/src/__tests__/pi-create-fn-agent.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/engine/src/__tests__/pi-create-fn-agent.test.ts b/packages/engine/src/__tests__/pi-create-fn-agent.test.ts index 346d63899a..24ea03ded5 100644 --- a/packages/engine/src/__tests__/pi-create-fn-agent.test.ts +++ b/packages/engine/src/__tests__/pi-create-fn-agent.test.ts @@ -2115,7 +2115,7 @@ describe("createFnAgent", () => { it("diagnostics are logged via structured logger with [skills] context", async () => { const { piLog } = await import("../logger.js"); - const piWarnSpy = vi.spyOn(piLog, "warn").mockImplementation(() => {}); + const piLogSpy = vi.spyOn(piLog, "log").mockImplementation(() => {}); // Test diagnostics logging by directly calling createSkillsOverrideFromSelection const { createSkillsOverrideFromSelection } = await import("../skill-resolver.js"); @@ -2141,7 +2141,7 @@ describe("createFnAgent", () => { expect(result.diagnostics.length).toBeGreaterThan(0); // Check that diagnostics were logged with [skills] context - const skillLogs = piWarnSpy.mock.calls.filter(call => + const skillLogs = piLogSpy.mock.calls.filter(call => String(call[0]).includes("[skills]") ); expect(skillLogs.length).toBeGreaterThan(0); @@ -2150,7 +2150,7 @@ describe("createFnAgent", () => { const lastLog = skillLogs[skillLogs.length - 1][0] as string; expect(lastLog).toContain("[executor]"); - piWarnSpy.mockRestore(); + piLogSpy.mockRestore(); }); }); });