{"record":{"id":"fb3a6a611f4f0e02","repo":"langchain-ai/langgraph","slug":"streamchannel-maxlen-must-be-a-positive-int-or-non","errorCode":null,"errorMessage":"StreamChannel maxlen must be a positive int or None","messagePattern":"StreamChannel maxlen must be a positive int or None","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/stream/stream_channel.py","lineNumber":68,"sourceCode":"        \"\"\"Initialize the channel.\n\n        Args:\n            name: Optional protocol channel name. When set, the\n                StreamMux wires every `push()` to also inject a\n                `ProtocolEvent` into the main event stream. Surfaced\n                on the wire as `custom:<name>` for user-defined\n                transformers, or as `<name>` for channels owned by a\n                native transformer (`_native = True`). When `None`,\n                the channel is local-only.\n            maxlen: Accepted for forward compatibility; currently\n                unused. The caller-driven pump bounds memory naturally\n                for single-consumer use.\n\n        Raises:\n            ValueError: If `maxlen` is not a positive integer or `None`.\n        \"\"\"\n        if maxlen is not None and maxlen <= 0:\n            raise ValueError(\"StreamChannel maxlen must be a positive int or None\")\n        self.name = name\n        self._items: deque[tuple[int, T]] = deque()\n        self._maxlen: int | None = maxlen\n        self._closed = False\n        self._error: BaseException | None = None\n\n        self._is_async: bool | None = None\n\n        self._subscribed = False\n\n        self._request_more: Callable[[], bool] | None = None\n        self._arequest_more: Callable[[], Awaitable[bool]] | None = None\n\n        self._wire_fn: Callable[[T], None] | None = None\n        self._mux: StreamMux | None = None\n\n    # ------------------------------------------------------------------\n    # Binding","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/stream/stream_channel.py#L50-L86","documentation":"Error \"StreamChannel maxlen must be a positive int or None\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/langgraph/langgraph/stream/stream_channel.py:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}