From 220239284902bedb326b4ddce9a44e6ccf7fbf07 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 11 Apr 2026 00:51:50 +0100 Subject: [PATCH] refactor: simplify exec stream chunks --- src/agents/bash-tools.exec-runtime.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agents/bash-tools.exec-runtime.ts b/src/agents/bash-tools.exec-runtime.ts index 674a0709e6c..2b9942ce4db 100644 --- a/src/agents/bash-tools.exec-runtime.ts +++ b/src/agents/bash-tools.exec-runtime.ts @@ -629,7 +629,7 @@ export async function runExecProcess(opts: { }; const handleStdout = (data: string) => { - const raw = data.toString(); + const raw = data; // Detect smkx/rmkx BEFORE sanitizeBinaryOutput strips ESC sequences. // Note: PTY chunking is arbitrary, but smkx/rmkx sequences are typically short (4-5 bytes) // and sent atomically by terminals. Split across chunks is rare in practice. @@ -645,7 +645,7 @@ export async function runExecProcess(opts: { }; const handleStderr = (data: string) => { - const str = sanitizeBinaryOutput(data.toString()); + const str = sanitizeBinaryOutput(data); for (const chunk of chunkString(str)) { appendOutput(session, "stderr", chunk); emitUpdate();