mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 00:02:29 +00:00
perf: stop archive size scan once over budget (#20304)
Co-authored-by: Orca Worker <orca-worker@localhost>
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user