mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-21 08:47:13 -07:00
fix(quality): Retry invalid stream only 1 time (#9169)
This commit is contained in:
@@ -891,11 +891,11 @@ describe('GeminiChat', () => {
|
|||||||
}
|
}
|
||||||
}).rejects.toThrow(InvalidStreamError);
|
}).rejects.toThrow(InvalidStreamError);
|
||||||
|
|
||||||
// Should be called 3 times (initial + 2 retries)
|
// Should be called 2 times (initial + 1 retry)
|
||||||
expect(mockContentGenerator.generateContentStream).toHaveBeenCalledTimes(
|
expect(mockContentGenerator.generateContentStream).toHaveBeenCalledTimes(
|
||||||
3,
|
2,
|
||||||
);
|
);
|
||||||
expect(mockLogContentRetry).toHaveBeenCalledTimes(2);
|
expect(mockLogContentRetry).toHaveBeenCalledTimes(1);
|
||||||
expect(mockLogContentRetryFailure).toHaveBeenCalledTimes(1);
|
expect(mockLogContentRetryFailure).toHaveBeenCalledTimes(1);
|
||||||
|
|
||||||
// History should be clean, as if the failed turn never happened.
|
// History should be clean, as if the failed turn never happened.
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ interface ContentRetryOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const INVALID_CONTENT_RETRY_OPTIONS: ContentRetryOptions = {
|
const INVALID_CONTENT_RETRY_OPTIONS: ContentRetryOptions = {
|
||||||
maxAttempts: 3, // 1 initial call + 2 retries
|
maxAttempts: 2, // 1 initial call + 1 retry
|
||||||
initialDelayMs: 500,
|
initialDelayMs: 500,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user