diff --git a/packages/agent-core-v2/src/agent/fullCompaction/fullCompactionService.ts b/packages/agent-core-v2/src/agent/fullCompaction/fullCompactionService.ts index 7f659a809..b56204bb9 100644 --- a/packages/agent-core-v2/src/agent/fullCompaction/fullCompactionService.ts +++ b/packages/agent-core-v2/src/agent/fullCompaction/fullCompactionService.ts @@ -427,6 +427,12 @@ export class AgentFullCompactionService extends Disposable implements IAgentFull messages, maxOutputSize: compactionMaxOutputSize, source: { type: 'operation', requestKind: 'full_compaction' }, + retry: { + maxAttempts: MAX_COMPACTION_RETRY_ATTEMPTS, + onRetry: () => { + retryCount += 1; + }, + }, }, undefined, signal, diff --git a/packages/agent-core-v2/test/fullCompaction/full.test.ts b/packages/agent-core-v2/test/fullCompaction/full.test.ts index bcebc7361..0af940c65 100644 --- a/packages/agent-core-v2/test/fullCompaction/full.test.ts +++ b/packages/agent-core-v2/test/fullCompaction/full.test.ts @@ -786,6 +786,7 @@ describe('FullCompaction', () => { await compacted; expect(attempts).toBe(2); + vi.useRealTimers(); await ctx.expectResumeMatches(); }); @@ -817,6 +818,7 @@ describe('FullCompaction', () => { await vi.advanceTimersByTimeAsync(10_000); expect(attempts).toBe(1); + vi.useRealTimers(); await ctx.expectResumeMatches(); }); @@ -988,6 +990,7 @@ describe('FullCompaction', () => { error_type: 'APIConnectionError', }), }); + vi.useRealTimers(); await ctx.expectResumeMatches(); });