BigPizzaV3/CodexPlusPlus · error · SystemExit
获取二维码失败:响应里没有 qrcode。
Error message
获取二维码失败:响应里没有 qrcode。
What it means
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.
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.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at tools/codex-wechat/codex_wechat.py:768 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/0770cbab3e6be1d0.
Report an issue: GitHub.
Appendix: source
Thrown at tools/codex-wechat/codex_wechat.py:768
failures += 1
log(f"iLink 网络错误:{exc}")
time.sleep(cfg.backoff_delay_seconds if failures >= cfg.max_consecutive_failures else cfg.retry_delay_seconds)
if failures >= cfg.max_consecutive_failures:
failures = 0
except Exception as exc:
failures += 1
log(f"轮询异常:{exc}")
time.sleep(cfg.backoff_delay_seconds if failures >= cfg.max_consecutive_failures else cfg.retry_delay_seconds)
if failures >= cfg.max_consecutive_failures:
failures = 0
def qr_login(output: Path, bot_type: str, timeout_seconds: int) -> None:
resp = api_get(ILINK_BASE_URL, f"{EP_GET_BOT_QR}?bot_type={urllib.parse.quote(bot_type)}", timeout=35)
qrcode = str(resp.get("qrcode") or "")
qrcode_url = str(resp.get("qrcode_img_content") or "")
if not qrcode:
raise SystemExit("获取二维码失败:响应里没有 qrcode。")
print("请用微信扫描下面的二维码链接:")
print(qrcode_url)
print()
deadline = time.time() + timeout_seconds
current_base = ILINK_BASE_URL
while time.time() < deadline:
status_resp = api_get(
current_base,
f"{EP_GET_QR_STATUS}?qrcode={urllib.parse.quote(qrcode)}",
timeout=35,
)
status = str(status_resp.get("status") or "wait")
if status == "wait":
print(".", end="", flush=True)
elif status == "scaned":
print("\n已扫码,请在微信中确认。")View on GitHub (pinned to b1ed92e5e4)