{"record":{"id":"d3987d3f97bd181c","repo":"langchain-ai/langgraph","slug":"protocol-command-did-not-return-a-valid-response-d3987d","errorCode":null,"errorMessage":"Protocol command did not return a valid response.","messagePattern":"Protocol command did not return a valid response\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/stream/transport/ws.py","lineNumber":71,"sourceCode":"        self._ping_timeout = ping_timeout\n        self._closed = False\n        self._event_streams: set[asyncio.Task[None]] = set()\n\n    async def send_command(self, command: dict[str, Any]) -> dict[str, Any] | None:\n        if self._closed:\n            raise RuntimeError(\"Protocol transport is closed.\")\n        merged_headers = {**self._default_headers, \"content-type\": \"application/json\"}\n        response = await self._client.post(\n            self._commands_url,\n            content=orjson.dumps(command),\n            headers=merged_headers,\n        )\n        response.raise_for_status()\n        if response.status_code in (202, 204):\n            return None\n        payload = orjson.loads(response.content)\n        if not isinstance(payload, dict) or \"id\" not in payload:\n            raise RuntimeError(\"Protocol command did not return a valid response.\")\n        return payload\n\n    def open_event_stream(self, params: dict[str, Any]) -> EventStreamHandle:\n        if self._closed:\n            raise RuntimeError(\"Protocol transport is closed.\")\n\n        loop = asyncio.get_running_loop()\n        ready: asyncio.Future[None] = loop.create_future()\n        done: asyncio.Future[BaseException | None] = loop.create_future()\n        queue: asyncio.Queue[Event | None] = asyncio.Queue(maxsize=self._max_queue_size)\n        cancel_event = asyncio.Event()\n        ws_holder: dict[str, Any] = {\"ws\": None}\n\n        async def pump() -> None:\n            try:\n                url = build_websocket_url(self._client.base_url, self._stream_path)\n                handshake_headers = list(websocket_headers(self._default_headers))\n                cookie_header = _cookie_header(self._client, self._stream_path)","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/stream/transport/ws.py#L53-L89","documentation":"Error \"Protocol command did not return a valid response.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/stream/transport/ws.py:71 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"}