HKUDS/nanobot · error · RuntimeError
{desc}
Error message
{desc} What it means
Generic sentinel in login_github_copilot's device-flow poll loop: GitHub returned an error string that is not authorization_pending, slow_down, expired_token, or access_denied. The raw provider error description ({desc}) is embedded; typically an invalid_client, device flow disabled, or unexpected server-side rejection.
Solutions
- Read the embedded desc for the GitHub OAuth error code
- Verify the Copilot OAuth client ID/scopes are valid for your account
- Retry the login; if it persists, check GitHub status or Copilot subscription entitlement
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at nanobot/providers/github_copilot_provider.py:146 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/9b1df9470e5c6516.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/providers/github_copilot_provider.py:146
if access_token:
token_expires_in = int(poll_payload.get("expires_in") or _LONG_LIVED_TOKEN_SECONDS)
break
error = poll_payload.get("error")
if error == "authorization_pending":
time.sleep(current_interval)
continue
if error == "slow_down":
current_interval += 5
time.sleep(current_interval)
continue
if error == "expired_token":
raise RuntimeError("GitHub device code expired. Please run login again.")
if error == "access_denied":
raise RuntimeError("GitHub device flow was denied.")
if error:
desc = poll_payload.get("error_description") or error
raise RuntimeError(str(desc))
time.sleep(current_interval)
else:
raise RuntimeError("GitHub device flow timed out.")
user = client.get(
user_url,
headers={
"Authorization": f"Bearer {access_token}",
"Accept": "application/vnd.github+json",
"User-Agent": USER_AGENT,
},
)
user.raise_for_status()
user_payload = user.json()
account_id = user_payload.get("login") or str(user_payload.get("id") or "") or None
expires_ms = int((time.time() + token_expires_in) * 1000)
token = OAuthToken(View on GitHub (pinned to 42f37dc4c0)