diff --git a/packages/core/src/core/geminiChat.test.ts b/packages/core/src/core/geminiChat.test.ts index d85609fec5..6e997ec9b1 100644 --- a/packages/core/src/core/geminiChat.test.ts +++ b/packages/core/src/core/geminiChat.test.ts @@ -891,11 +891,11 @@ describe('GeminiChat', () => { } }).rejects.toThrow(InvalidStreamError); - // Should be called 3 times (initial + 2 retries) + // Should be called 2 times (initial + 1 retry) expect(mockContentGenerator.generateContentStream).toHaveBeenCalledTimes( - 3, + 2, ); - expect(mockLogContentRetry).toHaveBeenCalledTimes(2); + expect(mockLogContentRetry).toHaveBeenCalledTimes(1); expect(mockLogContentRetryFailure).toHaveBeenCalledTimes(1); // History should be clean, as if the failed turn never happened. diff --git a/packages/core/src/core/geminiChat.ts b/packages/core/src/core/geminiChat.ts index 8088facb94..855ecc51ea 100644 --- a/packages/core/src/core/geminiChat.ts +++ b/packages/core/src/core/geminiChat.ts @@ -63,7 +63,7 @@ interface ContentRetryOptions { } const INVALID_CONTENT_RETRY_OPTIONS: ContentRetryOptions = { - maxAttempts: 3, // 1 initial call + 2 retries + maxAttempts: 2, // 1 initial call + 1 retry initialDelayMs: 500, };