fix(core): Fix unable to cancel edit tool (#9299)

This commit is contained in:
Sandy Tao
2025-09-24 12:16:00 -07:00
committed by GitHub
parent 66c2184fe5
commit ad59be0c81
6 changed files with 277 additions and 0 deletions
+6
View File
@@ -251,6 +251,9 @@ class EditToolInvocation implements ToolInvocation<EditToolParams, ToolResult> {
try {
editData = await this.calculateEdit(this.params, abortSignal);
} catch (error) {
if (abortSignal.aborted) {
throw error;
}
const errorMsg = error instanceof Error ? error.message : String(error);
console.log(`Error preparing edit: ${errorMsg}`);
return false;
@@ -336,6 +339,9 @@ class EditToolInvocation implements ToolInvocation<EditToolParams, ToolResult> {
try {
editData = await this.calculateEdit(this.params, signal);
} catch (error) {
if (signal.aborted) {
throw error;
}
const errorMsg = error instanceof Error ? error.message : String(error);
return {
llmContent: `Error preparing edit: ${errorMsg}`,