perf: stop archive size scan once over budget (#20304)

Co-authored-by: Orca Worker <orca-worker@localhost>
This commit is contained in:
OrcaWin
2026-09-12 18:09:12 -07:00
committed by GitHub
co-authored by Orca Worker
parent c35a479584
commit 2411491c2f
@@ -190,6 +190,9 @@ export function boundArchiveLines(lines: string[]): { lines: string[]; truncated
let total = 0
for (const line of lines) {
total += line.length + 1
if (total > TERMINAL_ARCHIVE_MAX_CHARS) {
break
}
}
if (total <= TERMINAL_ARCHIVE_MAX_CHARS) {
return { lines, truncated: false }