Skip to content

Modify stream mode messages and custom to respect subgraphs=False #4843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

nfcampos
Copy link
Contributor

  • When subgraphs=True not passed to top graph stream modes messages and custom will now behave as all other stream modes, and emit events only from the top graph
  • Previously these two stream modes ignored this flag and always emitted events for all subgraphs

Closes #4826

Copy link

vercel bot commented May 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langgraph-docs-preview ⬜️ Ignored (Inspect) Visit Preview May 27, 2025 11:08pm

@nfcampos nfcampos force-pushed the nc/27may/stream-subgraphs-messages-custom branch from ef02f12 to bc404d1 Compare May 27, 2025 23:07
@@ -5372,6 +5372,7 @@ async def outer_2(state: State):
]


@NEEDS_CONTEXTVARS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this addition?

Comment on lines +2443 to +2445
get_config()[CONF][CONFIG_KEY_CHECKPOINT_NS].split(NS_SEP)[
:-1
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sort of a scary op

Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely something we want to do consistently for v1

Base automatically changed from nc/25may/rm-checkpoint-writes to main May 28, 2025 21:04
@nfcampos nfcampos merged commit 26d5fcc into main May 28, 2025
51 checks passed
@nfcampos nfcampos deleted the nc/27may/stream-subgraphs-messages-custom branch May 28, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Streaming context leaks between nested graph invocations when using .astream() and .ainvoke()
2 participants