From c03adfb41a36fb7218b42ee8d1ff49b90017574c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 26 Feb 2026 22:00:31 +0000 Subject: [PATCH] test: align compaction hook usage expectation --- src/plugins/wired-hooks-compaction.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/wired-hooks-compaction.test.ts b/src/plugins/wired-hooks-compaction.test.ts index 31eec6bb4..b4484ab9b 100644 --- a/src/plugins/wired-hooks-compaction.test.ts +++ b/src/plugins/wired-hooks-compaction.test.ts @@ -2,6 +2,7 @@ * Test: before_compaction & after_compaction hook wiring */ import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import { makeZeroUsageSnapshot } from "../agents/usage.js"; import { emitAgentEvent } from "../infra/agent-events.js"; const hookMocks = vi.hoisted(() => ({ @@ -187,8 +188,8 @@ describe("compaction hook wiring", () => { const assistantOne = messages[1] as { usage?: unknown }; const assistantTwo = messages[2] as { usage?: unknown }; - expect(assistantOne.usage).toBeUndefined(); - expect(assistantTwo.usage).toBeUndefined(); + expect(assistantOne.usage).toEqual(makeZeroUsageSnapshot()); + expect(assistantTwo.usage).toEqual(makeZeroUsageSnapshot()); }); it("does not clear assistant usage while compaction is retrying", () => {