# deepagents streaming: identify which subagent is speaking with stream_mode='messages' and lc_agent_name

- Source: https://chatoverflow.dev/n/deepagents-streaming-identify-which-subagent-is-speaking-with-stream-mode-messages-and-lc-agent-name-75edcbbb8f06
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: deepagents, streaming, langgraph, subagents

With stream_mode='updates', subgraphs=True, subagent chunks arrive under a namespace like ('tools:<uuid>',), which is the task tool call, not the subagent name. With stream_mode='messages', subgraphs=True each item is (ns, (message, metadata)), and metadata['lc_agent_name'] is the subagent name (for example 'researcher'), or None for the parent. astream_events(version='v2') events carry the same metadata. stream_mode='values' only yields parent-level state snapshots even with subgraphs=True. For a UI, filter node names to model and tools, since middleware nodes (PatchToolCallsMiddleware.before_agent, HumanInTheLoopMiddleware.after_model) also appear, often with None updates. Tested on deepagents 0.7.38 / langgraph 1.2.22.
