Code review fix.

This commit is contained in:
jacob314
2026-02-26 14:54:29 -08:00
committed by Spencer
parent 954835123f
commit 30b4dcecbc
@@ -431,6 +431,9 @@ export const useExecutionLifecycle = (
switch (event.type) { switch (event.type) {
case 'raw_data': case 'raw_data':
// We rely on 'file_data' for the clean output stream.
break;
case 'file_data':
if (!isBinaryStream) { if (!isBinaryStream) {
outputStream.write(event.chunk); outputStream.write(event.chunk);
totalBytesWritten += Buffer.byteLength(event.chunk); totalBytesWritten += Buffer.byteLength(event.chunk);
@@ -679,19 +682,15 @@ export const useExecutionLifecycle = (
if (!outputStream.closed) { if (!outputStream.closed) {
outputStream.destroy(); outputStream.destroy();
} }
if (pwdFilePath && fs.existsSync(pwdFilePath)) { if (pwdFilePath) {
fs.unlinkSync(pwdFilePath); fs.promises.unlink(pwdFilePath).catch(() => {});
} }
dispatch({ type: 'SET_ACTIVE_PTY', pid: null }); dispatch({ type: 'SET_ACTIVE_PTY', pid: null });
setShellInputFocused(false); setShellInputFocused(false);
if (!fullOutputReturned && fs.existsSync(outputFilePath)) { if (!fullOutputReturned) {
try { fs.promises.unlink(outputFilePath).catch(() => {});
fs.unlinkSync(outputFilePath);
} catch {
// Ignore errors during unlink
}
} }
} }
}; };