Skip to content

Conversation

@casparb
Copy link
Collaborator

@casparb casparb commented Nov 20, 2025

This PR improves the consistency of interrupt streaming.

  • when streaming with stream_mode values, the stream chunk now contains the entire state alongside the interrupt:
class State(TypedDict):
    robot_input: str
# at this point in time robot_input is already set to  "beep boop i am a robot"
app.stream(..., stream_mode="values")
# before
{"__interrupt__": (Interrupt(value="interrupt",))}}
# after
{"robot_input": "beep boop i am a robot", "__interrupt__": (Interrupt(value="interrupt"))}
  • when streaming with stream_mode=["values", "updates"], interrupts are surfaced in both an update stream chunk and the value stream chunk, when previously we keep interrupt in values only if we request values mode only
class State(TypedDict):
    robot_input: str
# at this point in time robot_input is already set to  "beep boop i am a robot"
app.stream(..., stream_mode=["values", "updates"])
# before (interrupt would only emit on update chunk, there would be no values chunk)
("updates", {"__interrupt__": (Interrupt(value="interrupt",))}})
# after
("updates", {"__interrupt__": (Interrupt(value="interrupt",))}})
("values", {"robot_input": "beep boop i am a robot", "__interrupt__": (Interrupt(value="interrupt"))})

For housekeeping: this PR improves on this revert: #6141

@vercel
Copy link

vercel bot commented Nov 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langgraph-docs-preview Ignored Ignored Preview Nov 20, 2025 8:32pm

@sydney-runkle
Copy link
Collaborator

I'm a little confused, if we only have one stream mode, why is the result a tuple now?

@casparb
Copy link
Collaborator Author

casparb commented Nov 20, 2025

I'm a little confused, if we only have one stream mode, why is the result a tuple now?

@sydney-runkle incorrect example, updated

the tuple in the test is because we have two stream modes but in the pr desc it shouldn't have been a tuple

@casparb casparb force-pushed the caspar/interrupt-stream-mode-values branch from a96a2f2 to cf8c3a5 Compare November 20, 2025 20:15
@casparb casparb merged commit 2284a54 into main Nov 20, 2025
67 checks passed
@casparb casparb deleted the caspar/interrupt-stream-mode-values branch November 20, 2025 22:23
hinthornw added a commit that referenced this pull request Nov 25, 2025
This patch release includes a couple of small fixes and improvements,
such as:
- Include interrupt information in the values stream mode (no longer
rely solely on the updates stream mode):
#6475
- Omit thread_id from configurable to allow using context for stateful
runs via RemoteGraph:
#6497
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants