langchain-ai/langgraph · error · TypeError
StreamChannel is bound to async mode — sync interleave()…
Error message
StreamChannel {name!r} is bound to async mode — sync interleave() cannot consume async channels. What it means
Raised by the synchronous interleave() when a requested StreamChannel was bound to async mode. A sync cursor cannot pump an async-bound channel, so mixing sync consumption with async channels is rejected with a TypeError. Use the async interleave variant or bind the channel to sync mode.
Solutions
- Use the async interleave() (under astream) for async-bound channels
- Bind the channel in sync mode by running sync stream()
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at libs/langgraph/langgraph/stream/run_stream.py:270 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/d3efa5c4440e7b04.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/stream/run_stream.py:270
"""
from langgraph.stream.stream_channel import StreamChannel
channels: dict[str, StreamChannel[Any]] = {}
try:
for name in names:
ch = self.extensions[name]
if not isinstance(ch, StreamChannel):
raise TypeError(
f"interleave() requires StreamChannel projections, "
f"got {type(ch).__name__} for {name!r}"
)
if ch._is_async is None:
raise TypeError(
f"StreamChannel {name!r} has not been bound yet. "
"Register the transformer with a StreamMux first."
)
if ch._is_async:
raise TypeError(
f"StreamChannel {name!r} is bound to async mode — "
"sync interleave() cannot consume async channels."
)
if ch._subscribed:
raise RuntimeError(
f"StreamChannel {name!r} already has a subscriber; "
"use .tee(n) for fan-out."
)
ch._subscribed = True
channels[name] = ch
done: set[str] = set()
while len(done) < len(channels):
best: tuple[int, str] | None = None
for name, ch in channels.items():
if name in done:
continueView on GitHub (pinned to 38031739e5)