diff options
| author | N. Taylor Mullen <[email protected]> | 2025-06-08 15:42:49 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-08 22:42:49 +0000 |
| commit | f2ea78d0e4e5d25ab3cc25dc9f1492135630c9be (patch) | |
| tree | cdc80f281095a279c1c1746a5b4c1fbfa008dc20 /packages/core/src/tools/shell.ts | |
| parent | 7868ef82299ae1da5a09334f67d57eb3b472563a (diff) | |
fix(tool-scheduler): Correctly pipe cancellation signal to tool calls (#852)
Diffstat (limited to 'packages/core/src/tools/shell.ts')
| -rw-r--r-- | packages/core/src/tools/shell.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/core/src/tools/shell.ts b/packages/core/src/tools/shell.ts index 9ced00a4..caef67b9 100644 --- a/packages/core/src/tools/shell.ts +++ b/packages/core/src/tools/shell.ts @@ -162,6 +162,13 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> { }; } + if (abortSignal.aborted) { + return { + llmContent: 'Command was cancelled by user before it could start.', + returnDisplay: 'Command cancelled by user.', + }; + } + // wrap command to append subprocess pids (via pgrep) to temporary file const tempFileName = `shell_pgrep_${crypto.randomBytes(6).toString('hex')}.tmp`; const tempFilePath = path.join(os.tmpdir(), tempFileName); |
