mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
Fix message too large issue. (#19499)
This commit is contained in:
committed by
GitHub
parent
a00eb3b8e6
commit
c276d0c7b6
@@ -1082,6 +1082,15 @@ export class GeminiClient {
|
||||
this.updateTelemetryTokenCount();
|
||||
this.forceFullIdeContext = true;
|
||||
}
|
||||
} else if (info.compressionStatus === CompressionStatus.CONTENT_TRUNCATED) {
|
||||
if (newHistory) {
|
||||
// We truncated content to save space, but summarization is still "failed".
|
||||
// We update the chat context directly without resetting the failure flag.
|
||||
this.getChat().setHistory(newHistory);
|
||||
this.updateTelemetryTokenCount();
|
||||
// We don't reset the chat session fully like in COMPRESSED because
|
||||
// this is a lighter-weight intervention.
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
|
||||
@@ -180,6 +180,9 @@ export enum CompressionStatus {
|
||||
|
||||
/** The compression was not necessary and no action was taken */
|
||||
NOOP,
|
||||
|
||||
/** The compression was skipped due to previous failure, but content was truncated to budget */
|
||||
CONTENT_TRUNCATED,
|
||||
}
|
||||
|
||||
export interface ChatCompressionInfo {
|
||||
|
||||
Reference in New Issue
Block a user