{"record":{"id":"4823db11ab0bbc84","repo":"openai/codex","slug":"codex-process-is-not-running","errorCode":null,"errorMessage":"Codex process is not running","messagePattern":"Codex process is not running","errorType":"exception","errorClass":"TransportClosedError","httpStatus":null,"severity":"error","filePath":"sdk/python/src/openai_codex/client.py","lineNumber":838,"sourceCode":"        except BaseException as exc:\n            self._router.fail_all(exc)\n\n    def _stderr_tail(self, limit: int = 40) -> str:\n        return \"\\n\".join(list(self._stderr_lines)[-limit:])\n\n    def _handle_server_request(self, msg: dict[str, JsonValue]) -> JsonObject:\n        method = msg[\"method\"]\n        params = msg.get(\"params\")\n        if not isinstance(method, str):\n            return {}\n        return self._approval_handler(\n            method,\n            params if isinstance(params, dict) else None,\n        )\n\n    def _write_message(self, payload: JsonObject) -> None:\n        if self._proc is None or self._proc.stdin is None:\n            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","sourceCodeStart":820,"sourceCodeEnd":856,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/python/src/openai_codex/client.py#L820-L856","documentation":"Error \"Codex process is not running\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/python/src/openai_codex/client.py:838 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start the client before sending requests; if it crashed, inspect stderr output and relaunch."],"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"}