test: align compaction hook usage expectation

This commit is contained in:
Peter Steinberger
2026-02-26 22:00:31 +00:00
parent 31c0b04c49
commit c03adfb41a

View File

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