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