mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-23 08:02:23 +02:00
Reproduces: https://github.com/langchain-ai/langgraph/issues/5249#issuecomment-3156519635 Caused after this change: https://github.com/langchain-ai/langgraph/pull/4843 Fix to allow emitting messages from subgraphs if the subgraphs explicitly used a stream mode "messages". ```python def node_in_parent(...): # subgraph was called as a function. # messages are explicitly requested. for event in subgraph.stream(..., stream_mode="messages"): # something is done with `event` return ... # subgraphs = False! parent_graph.invoke(..., subgraphs=False) ``` The code above should continue to work correctly regardless of the value of subgraphs as streaming messages was requested explicitly in the parent node! --------- Co-authored-by: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com>