Files
oh-my-opencode/src/tools/delegate-task/cancel-unstable-agent-task.ts
T

20 lines
444 B
TypeScript

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,
}),
])
}