{"record":{"id":"9aa54bdd420faac5","repo":"openai/codex","slug":"invalid-json-rpc-line-line-r","errorCode":null,"errorMessage":"Invalid JSON-RPC line: {line!r}","messagePattern":"Invalid JSON-RPC line: (.+?)","errorType":"exception","errorClass":"CodexError","httpStatus":null,"severity":"error","filePath":"sdk/python/src/openai_codex/client.py","lineNumber":856,"sourceCode":"            raise TransportClosedError(\"Codex process is not running\")\n        with self._lock:\n            self._proc.stdin.write(json.dumps(payload) + \"\\n\")\n            self._proc.stdin.flush()\n\n    def _read_message(self) -> dict[str, JsonValue]:\n        if self._proc is None or self._proc.stdout is None:\n            raise TransportClosedError(\"Codex process is not running\")\n\n        line = self._proc.stdout.readline()\n        if not line:\n            raise TransportClosedError(\n                f\"Codex process closed stdout. stderr_tail={self._stderr_tail()[:2000]}\"\n            )\n\n        try:\n            message = json.loads(line)\n        except json.JSONDecodeError as exc:\n            raise CodexError(f\"Invalid JSON-RPC line: {line!r}\") from exc\n\n        if not isinstance(message, dict):\n            raise CodexError(f\"Invalid JSON-RPC payload: {message!r}\")\n        return message\n\n\ndef default_codex_home() -> str:\n    return str(Path.home() / \".codex\")\n","sourceCodeStart":838,"sourceCodeEnd":865,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/python/src/openai_codex/client.py#L838-L865","documentation":"Error \"Invalid JSON-RPC line: {line!r}\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/python/src/openai_codex/client.py:856 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update SDK and runtime to matching protocol versions; the process emitted a non JSON-RPC line."],"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"}