diff options
| author | Olcan <[email protected]> | 2025-05-27 13:47:40 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-27 13:47:40 -0700 |
| commit | 0c5673875ba471ae7991f28c61c53758969b6f70 (patch) | |
| tree | 36def90a72c7dc8b735824211bbce931669eb252 /packages/server/src | |
| parent | 4e3c539f5eda23f4eab111dc95c81e8973cb5199 (diff) | |
improve shell tool output when cancelled in debug mode (#571)
Diffstat (limited to 'packages/server/src')
| -rw-r--r-- | packages/server/src/tools/shell.ts | 7 |
1 files changed, 6 insertions, 1 deletions
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<ShellToolParams, ToolResult> { 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}`, |
