{"record":{"id":"0770cbab3e6be1d0","repo":"BigPizzaV3/CodexPlusPlus","slug":"qrcode","errorCode":null,"errorMessage":"获取二维码失败：响应里没有 qrcode。","messagePattern":"获取二维码失败：响应里没有 qrcode。","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"tools/codex-wechat/codex_wechat.py","lineNumber":768,"sourceCode":"            failures += 1\n            log(f\"iLink 网络错误：{exc}\")\n            time.sleep(cfg.backoff_delay_seconds if failures >= cfg.max_consecutive_failures else cfg.retry_delay_seconds)\n            if failures >= cfg.max_consecutive_failures:\n                failures = 0\n        except Exception as exc:\n            failures += 1\n            log(f\"轮询异常：{exc}\")\n            time.sleep(cfg.backoff_delay_seconds if failures >= cfg.max_consecutive_failures else cfg.retry_delay_seconds)\n            if failures >= cfg.max_consecutive_failures:\n                failures = 0\n\n\ndef qr_login(output: Path, bot_type: str, timeout_seconds: int) -> None:\n    resp = api_get(ILINK_BASE_URL, f\"{EP_GET_BOT_QR}?bot_type={urllib.parse.quote(bot_type)}\", timeout=35)\n    qrcode = str(resp.get(\"qrcode\") or \"\")\n    qrcode_url = str(resp.get(\"qrcode_img_content\") or \"\")\n    if not qrcode:\n        raise SystemExit(\"获取二维码失败：响应里没有 qrcode。\")\n\n    print(\"请用微信扫描下面的二维码链接：\")\n    print(qrcode_url)\n    print()\n\n    deadline = time.time() + timeout_seconds\n    current_base = ILINK_BASE_URL\n    while time.time() < deadline:\n        status_resp = api_get(\n            current_base,\n            f\"{EP_GET_QR_STATUS}?qrcode={urllib.parse.quote(qrcode)}\",\n            timeout=35,\n        )\n        status = str(status_resp.get(\"status\") or \"wait\")\n        if status == \"wait\":\n            print(\".\", end=\"\", flush=True)\n        elif status == \"scaned\":\n            print(\"\\n已扫码，请在微信中确认。\")","sourceCodeStart":750,"sourceCodeEnd":786,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/tools/codex-wechat/codex_wechat.py#L750-L786","documentation":"qr_login called the WeChat/iLink QR code endpoint, got an HTTP 200 response, but the parsed JSON body has no qrcode field. The login service replied in an unexpected shape (possibly an error payload with 200 status or an API change), so there is nothing to display or poll for scanning.","triggerScenarios":"Thrown at tools/codex-wechat/codex_wechat.py:768 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Dump the full response body to see what the service actually returned (error code, captcha requirement, maintenance notice).","Retry after a short delay — transient service-side hiccups often produce malformed bodies.","Update the endpoint/field parsing if the iLink API response schema changed; consider re-authenticating the device."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}