[PR #3663] clarify subgraphs=True needed when wrapping create_agent #3697

Open
opened 2026-06-05 18:52:51 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/3663
Author: @mdrxy
Created: 4/21/2026
Status: 🔄 Open

Base: mainHead: mdrxy/subgraph-cr-agent


📝 Commits (2)

  • 8c77f76 clarify subgraphs=True needed when wrapping create_agent
  • b3e91d8 cr

📊 Changes

2 files changed (+57 additions, -0 deletions)

View changed files

📝 src/oss/langchain/streaming.mdx (+4 -0)
📝 src/oss/langgraph/streaming.mdx (+53 -0)

📄 Description

Document a subtle streaming gotcha: when create_agent (a compiled graph) is added as a node in a parent StateGraph, it becomes a subgraph, and stream_mode="messages" won't emit inner LLM tokens without subgraphs=True. This commonly surfaces when code that streams tokens fine via agent.astream(...) suddenly goes silent after wrapping.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/3663 **Author:** [@mdrxy](https://github.com/mdrxy) **Created:** 4/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `mdrxy/subgraph-cr-agent` --- ### 📝 Commits (2) - [`8c77f76`](https://github.com/langchain-ai/docs/commit/8c77f76fcc31f3c0060935cc1dd80f0608567393) clarify `subgraphs=True` needed when wrapping `create_agent` - [`b3e91d8`](https://github.com/langchain-ai/docs/commit/b3e91d8733a809c0e05b1f0f94f6197dc87a3141) cr ### 📊 Changes **2 files changed** (+57 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/streaming.mdx` (+4 -0) 📝 `src/oss/langgraph/streaming.mdx` (+53 -0) </details> ### 📄 Description Document a subtle streaming gotcha: when `create_agent` (a compiled graph) is added as a node in a parent `StateGraph`, it becomes a subgraph, and `stream_mode="messages"` won't emit inner LLM tokens without `subgraphs=True`. This commonly surfaces when code that streams tokens fine via `agent.astream(...)` suddenly goes silent after wrapping. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 18:52:51 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#3697