HKUDS/nanobot · error · RuntimeError

Feishu / Lark registration did not return a login URL

Error message

Feishu / Lark registration did not return a login URL

What it means

Response-shape check in _begin_registration: the registration 'begin' response returned a device_code but no verification_uri_complete login URL, so there is nothing to render as a QR code for the user to scan; the flow is aborted with RuntimeError.

Solutions

  1. Retry the connect start
  2. Check upstream status of the Feishu/Lark accounts service
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at nanobot/channels/feishu/runtime.py:548 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/963ec03e439fa620. Report an issue: GitHub.

Appendix: source

Thrown at nanobot/channels/feishu/runtime.py:548

            f"Supported: {methods}"
        )


def _begin_registration(domain: str = "feishu") -> _RegistrationStart:
    """Start the device-code flow. Returns device_code, qr_url, interval, expire_in."""
    base_url = _accounts_base_url(domain)
    res = _post_registration(base_url, {
        "action": "begin",
        "archetype": "PersonalAgent",
        "auth_method": "client_secret",
        "request_user_info": "open_id",
    })
    device_code = res.get("device_code")
    if not isinstance(device_code, str) or not device_code:
        raise RuntimeError("Feishu / Lark registration did not return a device_code")
    qr_url = res.get("verification_uri_complete", "")
    if not isinstance(qr_url, str) or not qr_url:
        raise RuntimeError("Feishu / Lark registration did not return a login URL")
    interval = res.get("interval")
    expire_in = res.get("expire_in")
    return {
        "device_code": device_code,
        "qr_url": qr_url,
        "interval": interval if isinstance(interval, int) else 5,
        "expire_in": expire_in if isinstance(expire_in, int) else 600,
    }


def _poll_registration(
    *,
    device_code: str,
    interval: int,
    expire_in: int,
    domain: str = "feishu",
) -> dict[str, Any] | None:
    """Poll until the user scans the QR code, or timeout/denial.

View on GitHub (pinned to 42f37dc4c0)