From 0c5673875ba471ae7991f28c61c53758969b6f70 Mon Sep 17 00:00:00 2001 From: Olcan Date: Tue, 27 May 2025 13:47:40 -0700 Subject: [PATCH] improve shell tool output when cancelled in debug mode (#571) --- packages/server/src/tools/shell.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/server/src/tools/shell.ts b/packages/server/src/tools/shell.ts index dd8f8639..9e61717c 100644 --- a/packages/server/src/tools/shell.ts +++ b/packages/server/src/tools/shell.ts @@ -242,7 +242,12 @@ export class ShellTool extends BaseTool { let llmContent = ''; if (abortSignal.aborted) { - llmContent = 'Command did not complete, it was cancelled by the user'; + llmContent = 'Command was cancelled by user before it could complete.'; + if (output.trim()) { + llmContent += ` Below is the output (on stdout and stderr) before it was cancelled:\n${output}`; + } else { + llmContent += ' There was no output before it was cancelled.'; + } } else { llmContent = [ `Command: ${params.command}`,