From e064cfe0438a384a514d6e3375ee7fffb3b9e145 Mon Sep 17 00:00:00 2001 From: Spencer Date: Fri, 10 Apr 2026 16:43:03 +0000 Subject: [PATCH] fix(core): ensure childProcessFallback also streams file_data unconditionally without truncation --- .../src/services/shellExecutionService.ts | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/core/src/services/shellExecutionService.ts b/packages/core/src/services/shellExecutionService.ts index 090bce19f3..8d029116ef 100644 --- a/packages/core/src/services/shellExecutionService.ts +++ b/packages/core/src/services/shellExecutionService.ts @@ -375,7 +375,6 @@ export class ShellExecutionService { const outputFilePath = path.join(os.tmpdir(), outputFileName); const outputStream = fs.createWriteStream(outputFilePath); - let isBinaryStream = false; let totalBytesWritten = 0; const interceptedOnOutputEvent = (event: ShellOutputEvent) => { @@ -383,14 +382,11 @@ export class ShellExecutionService { case 'raw_data': break; case 'file_data': - if (!isBinaryStream) { - outputStream.write(event.chunk); - totalBytesWritten += Buffer.byteLength(event.chunk); - } + outputStream.write(event.chunk); + totalBytesWritten += Buffer.byteLength(event.chunk); break; case 'binary_detected': case 'binary_progress': - isBinaryStream = true; break; default: break; @@ -788,6 +784,24 @@ export class ShellExecutionService { } if (decodedChunk) { + const rawEvent: ShellOutputEvent = { + type: 'raw_data', + chunk: decodedChunk, + }; + onOutputEvent(rawEvent); + if (child.pid) { + ExecutionLifecycleService.emitEvent(child.pid, rawEvent); + } + + const fileEvent: ShellOutputEvent = { + type: 'file_data', + chunk: stripAnsi(decodedChunk), + }; + onOutputEvent(fileEvent); + if (child.pid) { + ExecutionLifecycleService.emitEvent(child.pid, fileEvent); + } + const event: ShellOutputEvent = { type: 'data', chunk: decodedChunk,