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", () => {