You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
session.status event should include parentID to distinguish subagent sessions #30043
When opencode spawns a subagent (via the Task tool), the subagent runs as a child session with its own lifecycle. When the subagent completes, it emits a session.status idle event that is structurally identical to the one emitted when the main session completes:
Consumers watching the SSE event stream (e.g. the Warp terminal plugin @warp-dot-dev/opencode-warp) see this idle event and mark the tab as "done", even though the main agent session is still running.
The parentID field exists on the session model (session.info.parentID) and is populated when subagents are created in tool/task.ts, but it is not included in the session.status event — only in session.created and session.updated.
Proposed Fix
Add an optional parentID field to the session.status event schema so consumers can immediately distinguish subagent idle events from main session idle events, without needing to track session.created events separately.
Then in SessionStatus.set, the parentID needs to be resolved and passed through. The session info (including parentID) can be fetched from the Session service at publish time, or passed as an additional parameter.
This is backward compatible — the field is optional and existing consumers that ignore it will continue to work.
Consumer Guidance
After this ships, consumers watching for session completion should filter:
// Only react to main session completionif(event.type==="session.status"&&event.properties.status.type==="idle"){if(event.properties.parentID)return// subagent — ignore// main session is done}
Activity
nexxeln commentedon May 31, 2026
we'll think about this
for now you can fetch the session and see if it has a parent