Files
deepseek-harness/docs/graphs/subagent-lineage.md
2026-07-03 01:13:52 +08:00

28 lines
1.1 KiB
Markdown

<!-- Generated by scripts/gen-doc-graphs.ts - do not edit by hand.
Run `pnpm run gen-doc-graphs` to regenerate. -->
# Subagent And Session Lineage
Maintenance mode: curated Mermaid flow; provider inventory is visible in the generated capability seam graph.
This graph keeps delegation semantics separate from hook observation. A subagent backend creates an ordinary child agent/session through the shared provider registry.
```mermaid
flowchart TD
parent["Parent Agent + Session"]
tool["tool-subagent<br/>model-facing name"]
registry["ctx.subagents provider registry"]
spawn["spawn provider<br/>fresh child session"]
fork["fork provider<br/>seeded from completed-turn prefix"]
acp["ACP provider<br/>out-of-process child"]
child["Child AgentHandle<br/>ordinary Agent lifecycle"]
result["SubagentResult returned to tool"]
parent --> tool --> registry
registry --> spawn --> child
registry --> fork --> child
registry --> acp --> child
child --> result --> parent
```
The hooks stack adds richer lifecycle observation around child runs; the core ownership rule stays the same: the provider owns the child handle and must dispose it.