fix(delegate-task): cancel child background tasks on parent abort and timeout in unstable agent flow

This commit is contained in:
YeonGyu-Kim
2026-03-13 10:49:44 +09:00
parent 38938508fa
commit b356c50285
3 changed files with 207 additions and 0 deletions
@@ -0,0 +1,19 @@
import type { ExecutorContext } from "./executor-types"
export async function cancelUnstableAgentTask(
manager: ExecutorContext["manager"],
taskID: string | undefined,
reason: string
): Promise<void> {
if (!taskID || typeof manager.cancelTask !== "function") {
return
}
await Promise.allSettled([
manager.cancelTask(taskID, {
source: "unstable-agent-task",
reason,
skipNotification: true,
}),
])
}