[PR #6475] fix: interrupt stream mode values #5058

Closed
opened 2026-02-20 17:51:10 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6475

State: closed
Merged: Yes


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: https://github.com/langchain-ai/langgraph/pull/6141

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6475 **State:** closed **Merged:** Yes --- 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: ```python 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 ```python 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: https://github.com/langchain-ai/langgraph/pull/6141
yindo added the pull-request label 2026-02-20 17:51:10 -05:00
yindo closed this issue 2026-02-20 17:51:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#5058