langchain-ai/langgraph · error · RuntimeError

StreamChannel already has a subscriber; use .tee(n) for…

Error message

StreamChannel {name!r} already has a subscriber; use .tee(n) for fan-out.

What it means

Raised by RunStream.interleave() when a StreamChannel already has a subscriber attached. Each channel supports a single consumer; concurrent consumers would steal items from each other. Use .tee(n) to fan the stream out to multiple consumers instead.

Solutions

  1. Use ch.tee(n) before subscribing to get multiple cursors
  2. Iterate the channel from a single consumer only
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at libs/langgraph/langgraph/stream/run_stream.py:275 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/11ff9d8f8e413b87. Report an issue: GitHub.

Appendix: source

Thrown at libs/langgraph/langgraph/stream/run_stream.py:275

            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:
                        continue
                    if ch._closed and not ch._items:
                        if ch._error is not None:
                            raise ch._error
                        done.add(name)
                        continue

View on GitHub (pinned to 38031739e5)