feat(core): increase thought signature retry resilience

maxAttempts 2→3, initialDelayMs 500→1000 for "thought signature
chunk" errors to better handle transient API flakes.
This commit is contained in:
Bryan Morgan
2026-02-22 10:09:07 -05:00
parent 6b695e3c64
commit 80b4dde350
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -1315,11 +1315,11 @@ describe('GeminiChat', () => {
} }
}).rejects.toThrow(InvalidStreamError); }).rejects.toThrow(InvalidStreamError);
// Should be called 2 times (initial + 1 retry) // Should be called 3 times (initial + 2 retries)
expect(mockContentGenerator.generateContentStream).toHaveBeenCalledTimes( expect(mockContentGenerator.generateContentStream).toHaveBeenCalledTimes(
2, 3,
); );
expect(mockLogContentRetry).toHaveBeenCalledTimes(1); expect(mockLogContentRetry).toHaveBeenCalledTimes(2);
expect(mockLogContentRetryFailure).toHaveBeenCalledTimes(1); expect(mockLogContentRetryFailure).toHaveBeenCalledTimes(1);
// History should still contain the user message. // History should still contain the user message.
+2 -2
View File
@@ -86,8 +86,8 @@ interface ContentRetryOptions {
} }
const INVALID_CONTENT_RETRY_OPTIONS: ContentRetryOptions = { const INVALID_CONTENT_RETRY_OPTIONS: ContentRetryOptions = {
maxAttempts: 2, // 1 initial call + 1 retry maxAttempts: 3, // 1 initial call + 2 retries
initialDelayMs: 500, initialDelayMs: 1000,
}; };
export const SYNTHETIC_THOUGHT_SIGNATURE = 'skip_thought_signature_validator'; export const SYNTHETIC_THOUGHT_SIGNATURE = 'skip_thought_signature_validator';