
Subagent sessions for one conversation. Each row is a subagent conversation with its own model, request count, tool calls, and token usage.
With off-the-shelf headers
When you usex-session-id or x-session-affinity as the session signal, x-parent-session-id carries the parent pointer on its own. It needs no matching <name>, because the generic session headers have no name to match.
Custom applications
Give each spawned subagent its own session id, and name the parent’s. The parent header must use the same<name> as the session header. A parent header whose <name> does not match the session header is ignored.
For example, a custom application built with LangChain could use the following header structure:
- Give each spawned subagent a fresh session id of its own. Never reuse the parent’s session id for a child.
- The parent value is the parent’s session id exactly as the parent sends it. Do not transform it.
- Point at the conversation that directly spawned the subagent, not at the root of the whole run. A subagent of a subagent names its immediate parent.
- The link fills in on a later request if the subagent’s first request arrives before its parent has sent anything.