improve shell tool output when cancelled in debug mode (#571)

This commit is contained in:
Olcan 2025-05-27 13:47:40 -07:00 committed by GitHub
parent 4e3c539f5e
commit 0c5673875b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -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}`,