Files
openclaw/apps
samzong c3d49d70f9 feat(gateway): surface spawnedBy in chat and agent broadcast payloads
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>
2026-04-29 20:47:15 +08:00
..