langchain-ai/langgraph · error · RuntimeError

ToolCallHandle.deltas can only be iterated by a single consu

Error message

ToolCallHandle.deltas can only be iterated by a single consumer.

What it means

Error "ToolCallHandle.deltas can only be iterated by a single consumer." thrown in langchain-ai/langgraph.

Source

Thrown at libs/sdk-py/langgraph_sdk/_async/stream.py:999

        self.input = input
        self.namespace = list(namespace or [])
        self.done = False
        self.error: BaseException | None = None
        loop = asyncio.get_running_loop()
        self.output: asyncio.Future[Any] = loop.create_future()
        self._deltas: asyncio.Queue[str | None] = asyncio.Queue(maxsize=max_queue_size)
        self._deltas_consumed = False

    @property
    def deltas(self) -> AsyncIterator[str]:
        """Stream tool output deltas emitted before the terminal event.

        Raises:
            RuntimeError: if called more than once — the underlying queue is
                single-consumer and cannot be fanned out safely.
        """
        if self._deltas_consumed:
            raise RuntimeError(
                "ToolCallHandle.deltas can only be iterated by a single consumer."
            )
        self._deltas_consumed = True
        return self._delta_iter()

    async def _delta_iter(self) -> AsyncGenerator[str, None]:
        while True:
            item = await self._deltas.get()
            if item is None:
                return  # errors surface via output, not deltas
            yield item

    def _push_delta(self, delta: str) -> None:
        if self.done:
            return
        self._deltas.put_nowait(delta)

    def _finish(self, output: Any) -> None:

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/sdk-py/langgraph_sdk/_async/stream.py:999 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/72bfd154d84de4ed. Report an issue: GitHub.