mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:00:43 +00:00
Subagent sessions emitted chat and agent broadcast events with only sessionKey. Clients had to follow up with sessions.subscribe to learn the parent, creating a timing race. Inject spawnedBy at the six previously uncovered broadcast sites (emitChatDelta, flushBufferedChatDeltaIfNeeded, emitChatFinal done + error, seq gap error, non-tool agent event). resolveSpawnedBy reads from the session store directly. It short-circuits for session keys that cannot carry lineage (mirrors supportsSpawnLineage in sessions-patch.ts), so the hot chat delta path does not touch the store for normal sessions. No cache: spawnedBy is immutable once set, and the only frequent caller is the subagent/acp hot path which is already filtered by the lineage key check. Signed-off-by: samzong <samzong.lu@gmail.com>