langchain-ai/langgraph · error · RuntimeError

Protocol error [{code}]: {message}

Error message

Protocol error [{code}]: {message}

What it means

Error "Protocol error [{code}]: {message}" thrown in langchain-ai/langgraph.

Source

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

        Returns `{}` for 202/204 responses (no body). Raises `RuntimeError`
        with the protocol code/message when the server returns an error
        envelope (`{"type": "error", ...}`).
        """
        if self._transport is None:
            raise RuntimeError("AsyncThreadStream not entered — use `async with`.")
        command_id = self._next_command_id
        self._next_command_id += 1
        response = await self._transport.send_command(
            {"id": command_id, "method": method, "params": params}
        )
        if response is None:
            # 202/204 — no body. Caller gets an empty result.
            return {}
        if response.get("type") == "error":
            code = response.get("error", "unknown")
            message = response.get("message", "")
            raise RuntimeError(f"Protocol error [{code}]: {message}")
        meta = response.get("meta")
        if isinstance(meta, dict):
            applied_through_seq = meta.get("applied_through_seq")
            if self._controller is not None:
                self._controller.observe_applied_through_seq(applied_through_seq)
        return response.get("result", {})

    async def _await_run_start_gate(self, *, timeout: float | None = None) -> None:
        """Wait for the current run.start to commit the thread server-side.

        No-op when no run.start is in flight. Re-raises if run.start failed.
        Raises `asyncio.TimeoutError` if `timeout` is set and the gate does
        not resolve in time; the gate itself is left intact for later callers.
        """
        gate = self._run_start_ready
        if gate is None or gate.done():
            return
        if timeout is None:

View on GitHub (pinned to 38031739e5)

When it happens

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