



























@@ -60,6 +60,7 @@ describe("compaction hook wiring", () => {
6060incrementCompactionCount: vi.fn(),
6161getCompactionCount: () => params.compactionCount ?? 0,
6262noteCompactionTokensAfter: vi.fn(),
63+getLastCompactionTokensAfter: vi.fn(() => undefined),
6364 ...(params.withRetryHooks
6465 ? {
6566noteCompactionRetry: vi.fn(),
@@ -108,7 +109,7 @@ describe("compaction hook wiring", () => {
108109ctx: ReturnType<typeof createCompactionEndCtx> | Record<string, unknown>,
109110event: {
110111willRetry: boolean;
111-result?: { summary: string };
112+result?: { summary: string; tokensAfter?: number };
112113aborted?: boolean;
113114},
114115) {
@@ -185,6 +186,7 @@ describe("compaction hook wiring", () => {
185186expectedSessionKey: "agent:main:web-xyz",
186187});
187188expect(ctx.incrementCompactionCount).toHaveBeenCalledTimes(1);
189+expect(ctx.noteCompactionTokensAfter).toHaveBeenCalledWith(undefined);
188190expect(ctx.maybeResolveCompactionWait).toHaveBeenCalledTimes(1);
189191expect(hookMocks.emitAgentEvent).toHaveBeenCalledWith({
190192runId: "r2",
@@ -253,6 +255,7 @@ describe("compaction hook wiring", () => {
253255getCompactionCount: () => 1,
254256incrementCompactionCount: vi.fn(),
255257noteCompactionTokensAfter: vi.fn(),
258+getLastCompactionTokensAfter: vi.fn(() => undefined),
256259};
257260258261runCompactionEnd(ctx, { willRetry: false, result: { summary: "compacted" } });
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。