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
+2 -2
View File
@@ -1123,9 +1123,9 @@ describe('fileUtils', () => {
const formatted = formatTruncatedToolOutput(content, outputFile);
expect(formatted).toContain(
'Output too large. Showing the last 10,000 characters',
'Output too large. Showing the last 4,000 characters',
);
expect(formatted.endsWith(content.slice(-10000))).toBe(true);
expect(formatted.endsWith(content.slice(-4000))).toBe(true);
});
});
});
+1 -1
View File
@@ -517,7 +517,7 @@ export async function fileExists(filePath: string): Promise<boolean> {
}
const MAX_TRUNCATED_LINE_WIDTH = 1000;
const MAX_TRUNCATED_CHARS = 10000;
const MAX_TRUNCATED_CHARS = 4000;
/**
* Formats a truncated message for tool output, handling multi-line and single-line (elephant) cases.