# Conflicts: # docs/architecture.md # docs/config-catalog.md # docs/cordis-catalog/events.md # docs/cordis-catalog/services.md # docs/event-producer-consumer.md # docs/module-graph.md # docs/tool-catalog.md # packages/bash/tool-bash/tests/integration.spec.ts # packages/bash/tool-bash/tests/tools.spec.ts # packages/core/agent-core/tests/agent-core.spec.ts # packages/core/agent-loop/README.md # packages/core/agent-loop/src/index.ts # packages/core/agent/README.md # packages/core/agent/src/index.ts # packages/core/agent/tests/agent.spec.ts # packages/subagent/subagent/README.md # packages/subagent/subagent/src/index.ts # packages/subagent/tool-subagent/README.md # packages/subagent/tool-subagent/src/index.ts # pnpm-lock.yaml # scripts/doc-budgets.manifest.json
tasks/ — background task capability family
The shared background-task runtime: ONE home for task ids, owner isolation, polling, cancellation, wait, and completion notification, so bash, subagents, and every future long-running tool expose the same model-facing habit instead of cloning a private task protocol each. Rationale and the full design: the background-task-runtime RFC.
| Package | ctx key | Role |
|---|---|---|
tasks (@deepseek-ai/dsh-tasks) |
ctx.tasks |
The registry service: branded <kind>-N ids, owner-fenced read/kill/wait/list, settlement bookkeeping, the awaited owner-cleanup path, and the attachSurface misconfiguration fence |
tool-tasks (@deepseek-ai/dsh-tool-tasks) |
— | The model-facing control surface: task_output, task_list, task_kill, the completion-notice injection, and the background-habit prompt section |
The split is the state/surface boundary: the registry holds task state (an HMR reload of any tool plugin never orphans or kills a running task), while the tool surface is stateless presentation. Producers (dsh-tool-bash, dsh-tool-subagent) hand their work to ctx.tasks.start (preflight, then the producer's starter, then an atomic commit) and keep their own execution concerns; whether a producer exposes run_in_background is that producer's own enableRunInBackground config, never rewritten by this family.