[PR #6354] fix(langgraph): Unexpected behavior for stream_mode sequences that are not lists #4988

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

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

State: closed
Merged: Yes


Issue

The stream_mode argument type includes Sequence, but it doesn't correctly support non-list sequences. On the other hand, the print_mode argument works as expected.

Example

from langgraph.pregel.main import Pregel

pregel = Pregel(nodes={}, channels=None, input_channels=[], output_channels=[], auto_validate=False)
stream_modes, *_ = pregel._defaults(
    config={"recursion_limit": 1},
    stream_mode=("values", "messages"),
    print_mode=("values"),
    output_keys=None,
    interrupt_before=None,
    interrupt_after=None,
    durability=None,
)
print(stream_modes) # Expected `{'values', 'messages'}`, got `{('values', 'messages'), 'values'}`
**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6354 **State:** closed **Merged:** Yes --- ## Issue The `stream_mode` argument type includes `Sequence`, but it doesn't correctly support non-list sequences. On the other hand, the `print_mode` argument works as expected. ### Example ```python from langgraph.pregel.main import Pregel pregel = Pregel(nodes={}, channels=None, input_channels=[], output_channels=[], auto_validate=False) stream_modes, *_ = pregel._defaults( config={"recursion_limit": 1}, stream_mode=("values", "messages"), print_mode=("values"), output_keys=None, interrupt_before=None, interrupt_after=None, durability=None, ) print(stream_modes) # Expected `{'values', 'messages'}`, got `{('values', 'messages'), 'values'}` ```
yindo added the pull-request label 2026-02-20 17:51:03 -05:00
yindo closed this issue 2026-02-20 17:51:03 -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#4988