Fix message too large issue. (#19499)

This commit is contained in:
Christian Gunderman
2026-02-19 19:06:36 +00:00
committed by GitHub
parent a00eb3b8e6
commit c276d0c7b6
5 changed files with 52 additions and 5 deletions
+9
View File
@@ -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;
+3
View File
@@ -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 {