fix(FN-4429): guard step-session paused abort user cancel

Fusion-Task-Id: FN-4429
Fusion-Task-Lineage: b010437b-0e58-43f6-81b3-40dcebbf0873
This commit is contained in:
Fusion
2026-05-14 10:14:36 -07:00
committed by gsxdsm
parent 5000654338
commit 78612dee95

View File

@@ -2813,6 +2813,13 @@ export class TaskExecutor {
return;
}
if (this.pausedAborted.has(task.id)) {
if (this.userCanceledTaskIds.has(task.id)) {
this.pausedAborted.delete(task.id);
this.stuckAborted.delete(task.id);
this.userCanceledTaskIds.delete(task.id);
await this.store.logEntry(task.id, "Execution canceled by user — leaving task in todo");
return;
}
this.pausedAborted.delete(task.id);
await this.store.logEntry(task.id, "Execution paused — step sessions terminated, moved to todo", undefined, this.currentRunContext);
await this.store.moveTask(task.id, "todo", { preserveResumeState: true });
@@ -3021,6 +3028,13 @@ export class TaskExecutor {
this.depAborted.delete(task.id);
await this.handleDepAbortCleanup(task.id, worktreePath);
} else if (this.pausedAborted.has(task.id)) {
if (this.userCanceledTaskIds.has(task.id)) {
this.pausedAborted.delete(task.id);
this.stuckAborted.delete(task.id);
this.userCanceledTaskIds.delete(task.id);
await this.store.logEntry(task.id, "Execution canceled by user — leaving task in todo");
return;
}
this.pausedAborted.delete(task.id);
await this.store.logEntry(task.id, "Execution paused during step-session", undefined, this.currentRunContext);
await this.store.moveTask(task.id, "todo", { preserveResumeState: true });