{"record":{"id":"c85f3e7bc3351fba","repo":"openai/codex","slug":"unexpected-device-code-login-response-response-r","errorCode":null,"errorMessage":"unexpected device-code login response: {response_root!r}","messagePattern":"unexpected device-code login response: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdk/python/src/openai_codex/_login.py","lineNumber":72,"sourceCode":"    if not isinstance(response_root, ChatgptLoginAccountResponse):\n        raise RuntimeError(f\"unexpected ChatGPT login response: {response_root!r}\")\n    return AsyncChatgptLoginHandle(\n        owner,\n        response_root.login_id,\n        response_root.auth_url,\n    )\n\n\ndef start_device_code_login(client: CodexClient) -> DeviceCodeLoginHandle:\n    \"\"\"Start device-code ChatGPT login and return the handle for that attempt.\"\"\"\n    response = client.account_login_start(\n        LoginAccountParams(\n            root=ChatgptDeviceCodeLoginAccountParams(type=\"chatgptDeviceCode\"),\n        )\n    )\n    response_root = response.root\n    if not isinstance(response_root, ChatgptDeviceCodeLoginAccountResponse):\n        raise RuntimeError(f\"unexpected device-code login response: {response_root!r}\")\n    return DeviceCodeLoginHandle(\n        client,\n        response_root.login_id,\n        response_root.verification_url,\n        response_root.user_code,\n    )\n\n\nasync def async_start_device_code_login(\n    owner: _AsyncLoginOwner,\n) -> AsyncDeviceCodeLoginHandle:\n    \"\"\"Start async device-code ChatGPT login and return that attempt's handle.\"\"\"\n    response = await owner._client.account_login_start(\n        LoginAccountParams(\n            root=ChatgptDeviceCodeLoginAccountParams(type=\"chatgptDeviceCode\"),\n        )\n    )\n    response_root = response.root","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/python/src/openai_codex/_login.py#L54-L90","documentation":"Error \"unexpected device-code login response: {response_root!r}\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/python/src/openai_codex/_login.py:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the device-code login; if it persists, update the SDK to match the current response shape."],"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"}