fix(core): attempt compression before context overflow check (#16914)

This commit is contained in:
N. Taylor Mullen
2026-01-18 22:40:07 -08:00
committed by GitHub
parent 203f5209ba
commit 08c32f725e
7 changed files with 748 additions and 56 deletions
+7
View File
@@ -490,6 +490,7 @@ export class Config {
private readonly enablePromptCompletion: boolean = false;
private readonly truncateToolOutputThreshold: number;
private readonly truncateToolOutputLines: number;
private compressionTruncationCounter = 0;
private readonly enableToolOutputTruncation: boolean;
private initialized: boolean = false;
readonly storage: Storage;
@@ -1585,6 +1586,8 @@ export class Config {
return this.compressionThreshold;
}
await this.ensureExperimentsLoaded();
const remoteThreshold =
this.experiments?.flags[ExperimentFlags.CONTEXT_COMPRESSION_THRESHOLD]
?.floatValue;
@@ -1766,6 +1769,10 @@ export class Config {
return this.truncateToolOutputLines;
}
getNextCompressionTruncationId(): number {
return ++this.compressionTruncationCounter;
}
getUseWriteTodos(): boolean {
return this.useWriteTodos;
}