{"record":{"id":"5d2110632c3f14f3","repo":"langchain-ai/langgraph","slug":"streamchannel-is-already-bound","errorCode":null,"errorMessage":"StreamChannel is already bound","messagePattern":"StreamChannel is already bound","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/stream/stream_channel.py","lineNumber":105,"sourceCode":"    # ------------------------------------------------------------------\n\n    def _bind_mux(self, mux: StreamMux) -> None:\n        self._mux = mux\n\n    def _bind(self, *, is_async: bool) -> None:\n        \"\"\"Bind this channel to sync or async mode.\n\n        Called by the StreamMux after transformer registration. Must be\n        called exactly once before any iteration.\n\n        Args:\n            is_async: True to enable async iteration, False for sync.\n\n        Raises:\n            RuntimeError: If the channel has already been bound.\n        \"\"\"\n        if self._is_async is not None:\n            raise RuntimeError(\"StreamChannel is already bound\")\n        self._is_async = is_async\n\n    # ------------------------------------------------------------------\n    # Mux wiring (not called by transformers directly)\n    # ------------------------------------------------------------------\n\n    def _wire(self, fn: Callable[[T], None]) -> None:\n        \"\"\"Install the auto-forward callback (called by StreamMux).\"\"\"\n        self._wire_fn = fn\n\n    # ------------------------------------------------------------------\n    # Producer API\n    # ------------------------------------------------------------------\n\n    def push(self, item: T) -> None:\n        \"\"\"Append an item. Auto-forwards if wired.\n\n        The local buffer append is a no-op when no subscriber is","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/stream/stream_channel.py#L87-L123","documentation":"Raised by StreamChannel._bind when the channel has already been bound to a sync/async mode. Binding happens once during mux registration; a second bind indicates duplicate registration or manual misuse.","triggerScenarios":"Thrown at libs/langgraph/langgraph/stream/stream_channel.py:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register the channel's transformer with the mux only once","Create a fresh StreamChannel instead of rebinding an existing one"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}