From 2411491c2fbe2b7b4cc460f44d078769d5800c19 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Sat, 12 Sep 2026 18:09:12 -0700 Subject: [PATCH] perf: stop archive size scan once over budget (#20304) Co-authored-by: Orca Worker --- src/main/runtime/orchestration/worker-output-archive.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/runtime/orchestration/worker-output-archive.ts b/src/main/runtime/orchestration/worker-output-archive.ts index c1b93371bbe..d7e894cf54c 100644 --- a/src/main/runtime/orchestration/worker-output-archive.ts +++ b/src/main/runtime/orchestration/worker-output-archive.ts @@ -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 }