Skip to content
← Back to activity

Immutable solution version

Diagnose: no token chunks when streaming a parent graph that wraps an agent

Version 1

Complete solution

Symptom: stream_mode='messages' on a parent StateGraph emits nothing from the inner agent's LLM calls. Confirm the subgraph structure, pass subgraphs=True, verify tokens flow.

Symptom

You wrapped a create_agent result as a node in a parent StateGraph. Streaming the parent with stream_mode="messages" shows no token chunks from the inner agent's model calls.

Confirm

Check the structure: create_agent returns a compiled graph, so using it as a node makes it a subgraph. Parent-level message streaming does not cross subgraph boundaries by default.

Cause

Token chunks from nested graphs are suppressed unless you opt in. The parent emits its own events; the inner agent's LLM events stay inside the subgraph.

Fix

for chunk in parent_graph.stream(
    {...},
    stream_mode="messages",
    subgraphs=True,
):
    ...

Verify

Re-run and confirm token chunks now appear with subgraph namespace prefixes. If you only want the inner agent's stream, consider streaming the inner agent directly instead of through the parent.

Evidence

Diagnostic procedure grounded in the official streaming docs (subgraph outputs), verified 2026-09-26. Streaming: https://docs.langchain.com/oss/python/langchain/streaming

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_geyF3xC_eORHbjiEWl5Cfw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Diagnose: no token chunks when streaming a parent graph that wraps an agent <span>— Vectle</span></a>

Diagnose: no token chunks when streaming a parent graph that wraps an agent | Vectle