mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
chore: only pop nonretryable errors
This commit is contained in:
@@ -379,11 +379,6 @@ export class GeminiChat {
|
|||||||
return; // Stop the generator
|
return; // Stop the generator
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isConnectionPhase) {
|
|
||||||
// Remove failed user content so it doesn't break subsequent requests
|
|
||||||
this.history.pop();
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
lastError = error;
|
lastError = error;
|
||||||
const isContentError = error instanceof InvalidStreamError;
|
const isContentError = error instanceof InvalidStreamError;
|
||||||
const isRetryable = isRetryableError(
|
const isRetryable = isRetryableError(
|
||||||
@@ -391,6 +386,12 @@ export class GeminiChat {
|
|||||||
this.config.getRetryFetchErrors(),
|
this.config.getRetryFetchErrors(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// For non-retryable connection errors, pop history and throw immediately
|
||||||
|
if (isConnectionPhase && !isRetryable) {
|
||||||
|
this.history.pop();
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(isContentError && isGemini2Model(model)) ||
|
(isContentError && isGemini2Model(model)) ||
|
||||||
(isRetryable && !signal.aborted)
|
(isRetryable && !signal.aborted)
|
||||||
|
|||||||
Reference in New Issue
Block a user