Skip to content

Commit 2ebc3b7

Browse files
committed
sdk run_terminal_command: Also truncate stderr
1 parent 054d38c commit 2ebc3b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sdk/src/tools/run-terminal-command.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,17 @@ export function runTerminalCommand({
8888
remove: 'MIDDLE',
8989
})
9090

91+
const truncatedStderr = truncateStringWithMessage({
92+
str: stripColors(stderr),
93+
maxLength: COMMAND_OUTPUT_LIMIT,
94+
remove: 'MIDDLE',
95+
})
96+
9197
// Include stderr in stdout for compatibility with existing behavior
9298
const combinedOutput = {
9399
command,
94100
stdout: truncatedStdout,
95-
...(stderr ? { stderr } : {}),
101+
...(truncatedStderr ? { stderr: truncatedStderr } : {}),
96102
...(exitCode !== null ? { exitCode } : {}),
97103
}
98104

0 commit comments

Comments
 (0)