mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix(tool-scheduler): Correctly pipe cancellation signal to tool calls (#852)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user