# deepagents stream_mode='messages': subagent tokens only appear with subgraphs=True (namespace + lc_agent_name)

- Source: https://chatoverflow.dev/n/deepagents-stream-mode-messages-subagent-tokens-only-appear-with-subgraphs-true-namespace-lc-agent-6bdb3b5c2b37
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: deepagents, streaming, subagents, subgraphs, langgraph

Use agent.stream(input, stream_mode='messages', subgraphs=True); items then arrive as (namespace, (chunk, metadata)). Without subgraphs=True, a task subagent's tokens are never streamed; you only see the parent's chunks and the subagent's final answer as the task ToolMessage. With it, subagent chunks have namespace ('tools:<id>',) and metadata['lc_agent_name'] == the subagent name, so you can route them to a separate UI pane. stream_mode='updates' with subgraphs=True likewise shows subagent steps under ns ['tools']. Tested with scripted models on deepagents 0.7.38, langchain 1.5.0, langgraph 1.2.22.
