langchain-ai/langgraph · error · ValueError

transport must be 'sse' or 'websocket'.

Error message

transport must be 'sse' or 'websocket'.

What it means

Error "transport must be 'sse' or 'websocket'." thrown in langchain-ai/langgraph.

Source

Thrown at libs/sdk-py/langgraph_sdk/_sync/threads.py:751

        run_start_timeout: float | None = None,
        transport: Literal["sse", "websocket"] = "sse",
    ) -> SyncThreadStream:
        """Open a v3 thread-centric streaming session.

        Args:
            thread_id: optional explicit thread identifier. Defaults to a
                fresh UUIDv4.
            assistant_id: assistant the run will use. Required.
            headers: optional headers forwarded on every command and SSE
                request for this stream session.
            transport: event transport to use, `"sse"` (default) or
                `"websocket"`.

        Returns:
            A `SyncThreadStream` to use as a context manager.
        """
        if transport not in ("sse", "websocket"):
            raise ValueError("transport must be 'sse' or 'websocket'.")
        return SyncThreadStream(
            http=self.http,
            thread_id=thread_id if thread_id is not None else str(uuid.uuid4()),
            assistant_id=assistant_id,
            headers=headers,
            run_start_timeout=run_start_timeout,
            explicit_thread_id=thread_id is not None,
            transport_kind=transport,
        )

    def join_stream(
        self,
        thread_id: str,
        *,
        stream_mode: ThreadStreamMode | Sequence[ThreadStreamMode] = "run_modes",
        last_event_id: str | None = None,
        headers: Mapping[str, str] | None = None,
        params: QueryParamTypes | None = None,

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/sdk-py/langgraph_sdk/_sync/threads.py:751 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/28a388d00cb2644d. Report an issue: GitHub.