From 6902229faa97c59233729225e21c4b9fc1a2c282 Mon Sep 17 00:00:00 2001 From: gemini-cli-robot Date: Mon, 13 Oct 2025 16:58:04 -0700 Subject: [PATCH] fix(patch): cherry-pick dd01af6 to release/v0.9.0-preview.2-pr-11072 to patch version v0.9.0-preview.2 and create version 0.9.0-preview.3 (#11076) Co-authored-by: Gaurav <39389231+gsquared94@users.noreply.github.com> --- packages/core/src/utils/retry.test.ts | 16 ++++++++-------- packages/core/src/utils/retry.ts | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/core/src/utils/retry.test.ts b/packages/core/src/utils/retry.test.ts index abf9957669..60861d1de6 100644 --- a/packages/core/src/utils/retry.test.ts +++ b/packages/core/src/utils/retry.test.ts @@ -96,34 +96,34 @@ describe('retryWithBackoff', () => { expect(mockFn).toHaveBeenCalledTimes(3); }); - it('should default to 5 maxAttempts if no options are provided', async () => { - // This function will fail more than 5 times to ensure all retries are used. + it('should default to 3 maxAttempts if no options are provided', async () => { + // This function will fail more than 3 times to ensure all retries are used. const mockFn = createFailingFunction(10); const promise = retryWithBackoff(mockFn); // Expect it to fail with the error from the 5th attempt. await Promise.all([ - expect(promise).rejects.toThrow('Simulated error attempt 10'), + expect(promise).rejects.toThrow('Simulated error attempt 3'), vi.runAllTimersAsync(), ]); - expect(mockFn).toHaveBeenCalledTimes(10); + expect(mockFn).toHaveBeenCalledTimes(3); }); - it('should default to 10 maxAttempts if options.maxAttempts is undefined', async () => { - // This function will fail more than 5 times to ensure all retries are used. + it('should default to 3 maxAttempts if options.maxAttempts is undefined', async () => { + // This function will fail more than 3 times to ensure all retries are used. const mockFn = createFailingFunction(10); const promise = retryWithBackoff(mockFn, { maxAttempts: undefined }); // Expect it to fail with the error from the 5th attempt. await Promise.all([ - expect(promise).rejects.toThrow('Simulated error attempt 10'), + expect(promise).rejects.toThrow('Simulated error attempt 3'), vi.runAllTimersAsync(), ]); - expect(mockFn).toHaveBeenCalledTimes(10); + expect(mockFn).toHaveBeenCalledTimes(3); }); it('should not retry if shouldRetry returns false', async () => { diff --git a/packages/core/src/utils/retry.ts b/packages/core/src/utils/retry.ts index b1f79684fd..93a2fc5035 100644 --- a/packages/core/src/utils/retry.ts +++ b/packages/core/src/utils/retry.ts @@ -31,7 +31,7 @@ export interface RetryOptions { } const DEFAULT_RETRY_OPTIONS: RetryOptions = { - maxAttempts: 10, + maxAttempts: 3, initialDelayMs: 5000, maxDelayMs: 30000, // 30 seconds shouldRetryOnError: defaultShouldRetry,