diff --git a/docs/subsystems/gateway-sessions.md b/docs/subsystems/gateway-sessions.md index 588c7dbf8..a0e309112 100644 --- a/docs/subsystems/gateway-sessions.md +++ b/docs/subsystems/gateway-sessions.md @@ -366,8 +366,8 @@ files gets `Subagent` from the file's name, `/subagents/agent-.json or `/subagents/workflows//agent-.jsonl` (`sessions.SubagentOf`), so no cache version changes, and `ParentAgent` from the `parentAgentId` of the `agent-.meta.json` beside it, which Claude Code -writes for a subagent a subagent started (`sessions.SubagentParent`, read once -a file; a meta file not read is unknown and read again). A gateway row matched +writes for a subagent a subagent started (`sessions.SubagentParent`, through +`ccMeta`: read once a file; a meta file not read is unknown and read again). A gateway row matched to a file row keeps the gateway's own. Both were checked against Claude Code 2.1.296 spawning a subagent from a subagent. @@ -380,6 +380,48 @@ metadata, gateway-only entries and conflicting identities set `role` to `unknown` and do not acquire a guessed parent or root. These fields are omitted for other agents. This is Codex-specific (#1591). +A session whose agent keeps its subagents' conversations beside its own +lists them in `subagents` on the sessions API (`/api/sessions`, `one`, `manage`; #2261, +[`subagents.go`](../../internal/sessions/subagents.go)), only for agents with +a transcript, oldest first. Each has `id`, `title` (the task it was given), +`kind` (the agent it ran as), `parent` (the subagent that started it, empty +for the session) and `start`/`last`; its file is never sent. + +- Claude Code, Qoder and Qoder CN: each `subagents/agent-.jsonl` (and + under `workflows//`), with `agentType`, `description` and + `parentAgentId` from the meta file beside it (`ccMeta`). With no meta file + (Qoder), the title is the file's first user line (`ccTask`, at most 16 + lines read). `agent-acompact-.jsonl` is a compaction's own run and is + left out. +- OpenCode: a child session (`parent_id`, from the JSON store or + `opencode.db`) is a subagent of its root, not a session of its own; + `ocRoots` records its parent. Its title splits 1.x's + ` (@ subagent)`; 2.x titles it the description alone + (task tool, opencode 2.0.25), and a default `Child session -