diff --git a/packages/core/src/tools/shell.ts b/packages/core/src/tools/shell.ts
index 185c176593..aadfd8e394 100644
--- a/packages/core/src/tools/shell.ts
+++ b/packages/core/src/tools/shell.ts
@@ -354,16 +354,15 @@ export class ShellToolInvocation extends BaseToolInvocation<
} else {
// Create a formatted error string for display, replacing the wrapper command
// with the user-facing command.
- const output = result.output || '(empty)';
- const parts = [``];
+ const output = result.output || '(empty)';
+ const parts = [``];
if (result.error) {
const finalError = result.error.message.replaceAll(
commandToExecute,
this.params.command,
);
- parts.push(`${finalError}`);
- }
+ parts.push(``);
if (result.exitCode !== null) {
parts.push(`${result.exitCode}`);