fix(tools): close cancellation review gaps

This commit is contained in:
Tianyi Cui
2026-07-20 23:44:07 +08:00
parent 4311aaabb0
commit bd1805c637
7 changed files with 43 additions and 13 deletions

View File

@@ -422,6 +422,8 @@ export function apply(ctx: Context, config: Config = {}): void {
if (tasks === undefined) {
throw new Error('background tasks unavailable: load @deepseek-ai/dsh-tasks and @deepseek-ai/dsh-tool-tasks')
}
// The caller owns cancellation until TaskService commits detached ownership.
if (exec.signal.aborted) return []
// Task preflight finishes before the starter can spawn a process.
const id = tasks.start({
kind: 'bash',