{"record":{"id":"79305b0c32b34ed7","repo":"openai/codex","slug":"method-response-must-be-a-json-object","errorCode":null,"errorMessage":"{method} response must be a JSON object","messagePattern":"(.+?) response must be a JSON object","errorType":"exception","errorClass":"CodexError","httpStatus":null,"severity":"error","filePath":"sdk/python/src/openai_codex/client.py","lineNumber":320,"sourceCode":"                \"capabilities\": {\n                    \"experimentalApi\": self.config.experimental_api,\n                },\n            },\n            response_model=InitializeResponse,\n        )\n        self.notify(\"initialized\", None)\n        return result\n\n    def request(\n        self,\n        method: str,\n        params: JsonObject | None,\n        *,\n        response_model: type[ModelT],\n    ) -> ModelT:\n        result = self._request_raw(method, params)\n        if not isinstance(result, dict):\n            raise CodexError(f\"{method} response must be a JSON object\")\n        return response_model.model_validate(result)\n\n    def _request_raw(self, method: str, params: JsonObject | None = None) -> JsonValue:\n        \"\"\"Send a JSON-RPC request and wait for the reader thread to route its response.\"\"\"\n        request_id = str(uuid.uuid4())\n        waiter = self._router.create_response_waiter(request_id)\n\n        try:\n            message: JsonObject = {\"id\": request_id, \"method\": method}\n            if params is not None:\n                message[\"params\"] = params\n            self._write_message(message)\n        except BaseException:\n            self._router.discard_response_waiter(request_id)\n            raise\n\n        item = waiter.get()\n        if isinstance(item, BaseException):","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/python/src/openai_codex/client.py#L302-L338","documentation":"Error \"{method} response must be a JSON object\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/python/src/openai_codex/client.py:320 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update the SDK and runtime to matching versions so the method returns a JSON object per the protocol."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}