langchain-ai/langgraph · error · RuntimeError
StreamMux._make_child requires the mux to be constructed…
Error message
StreamMux._make_child requires the mux to be constructed with `factories=`; pre-built transformers can't be cloned to a new scope.
What it means
Raised by StreamMux._make_child when the mux was built from pre-built transformer instances rather than factories. Child muxes (for subgraph scopes) are created by calling factories with the new scope; instances cannot be cloned.
Solutions
- Construct StreamMux with factories= taking callables of scope
- Pass transformer classes or lambda scope: Transformer(scope) instead of instances
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at libs/langgraph/langgraph/stream/_mux.py:210 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/fc41eeb9f4972491.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/stream/_mux.py:210
def _make_child(self, scope: tuple[str, ...]) -> StreamMux:
"""Build a mini-mux with the same factories scoped to `scope`.
Used by `SubgraphTransformer` to attach a fresh transformer
pipeline to each discovered subgraph handle. The child mux
inherits the current pump bindings (so cursors on its
projection logs drive the root pump), carries the same factory
list forward to any grandchild subgraphs, and does not assign
`seq` numbers so forwarded events can be shared without
mutating their envelope.
Raises:
RuntimeError: If the mux was not constructed with
`factories=`. Mini-muxes require factories so each scope
gets its own fresh transformer instances.
"""
if self._factories is None:
raise RuntimeError(
"StreamMux._make_child requires the mux to be constructed "
"with `factories=`; pre-built transformers can't be "
"cloned to a new scope."
)
child = StreamMux(
factories=self._factories,
is_async=self.is_async,
scope=scope,
_assign_seq=False,
)
if self._pump_fn is not None:
child.bind_pump(self._pump_fn)
if self._apump_fn is not None:
child.bind_apump(self._apump_fn)
return child
def _register(self, transformer: StreamTransformer) -> None:
"""Register a single transformer.View on GitHub (pinned to 38031739e5)