fix(tasks): close background task review findings

This commit is contained in:
Yichen Jiang
2026-07-13 16:29:50 +08:00
parent e2bc79a0ef
commit 351a2e42b3
14 changed files with 78 additions and 25 deletions

View File

@@ -270,7 +270,7 @@ attachSurface(name: string): () => void
Types: [Agent](../core-data-structures/core.md)
Source: [`packages/tasks/tasks/src/index.ts:97`](../../packages/tasks/tasks/src/index.ts)
Source: [`packages/tasks/tasks/src/index.ts:99`](../../packages/tasks/tasks/src/index.ts)
## `ctx.tools` — `ToolRegistry`

View File

@@ -20,7 +20,7 @@ interface TaskStart {
label: string
/**
* The spawning agent. Its `session.header.id` becomes the task's owner
* token (read/kill/wait/list are fenced to that session), and its `ctx` scope
* identity (read/kill/wait/list are fenced to that session), and its `ctx` scope
* owns an async cleanup that cancels and awaits the task during disposal. It
* must be the exact live instance currently registered under its agent id;
* a stale object whose id has been reused is rejected before work starts.