Add optional `parentAgentId` to the session-event envelope for nested sub-agents
- Dominant language
- Java
- Stars
- 10.5k
- Forks
- 1.5k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 127
Description
Sub-agent session events carry only the innermost `agentId` on the event envelope. When sub-agents nest, a consumer receiving the event stream cannot reconstruct parent-of relationships — there is no field linking a sub-agent to the agent that spawned it.
Today a consumer has to infer the parent indirectly, by correlating each sub-agent's id with the id of the tool call that started it. That works but is fragile and couples consumers to an implementation detail.
**Request:** add an explicit optional `parentAgentId` to the session-event envelope — absent for top-level/root agents, set to the spawning agent's id for nested sub-agents — so parent chains are recoverable directly from the event stream.
Contributor guide
Research direction
No file or test is named in the issue; start by locating the session-event envelope definition and the code that creates nested sub-agent events. Trace how the spawning agent id is available, then verify that root events omit parentAgentId, nested events include it, and consumers can reconstruct the parent chain from the event stream.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100