zeroclaw-labs/zeroclaw · error

Google device code error: {} - {}

Error message

Google device code error: {} - {}

What it means

Error "Google device code error: {} - {}" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-providers/src/auth/gemini_oauth.rs:224

pub async fn start_device_code_flow(client: &Client, client_id: &str) -> Result<DeviceCodeStart> {
    let form = [("client_id", client_id), ("scope", GEMINI_OAUTH_SCOPES)];

    let response = client
        .post(GOOGLE_OAUTH_DEVICE_CODE_URL)
        .form(&form)
        .send()
        .await
        .context("Failed to start device code flow")?;

    let status = response.status();
    let body = response
        .text()
        .await
        .context("Failed to read device code response")?;

    if !status.is_success() {
        if let Ok(err) = serde_json::from_str::<OAuthErrorResponse>(&body) {
            anyhow::bail!(
                "Google device code error: {} - {}",
                err.error,
                err.error_description.unwrap_or_default()
            );
        }
        anyhow::bail!("Google device code request failed ({}): {}", status, body);
    }

    let device_response: DeviceCodeResponse =
        serde_json::from_str(&body).context("Failed to parse device code response")?;

    let user_code = device_response.user_code;
    let verification_url = device_response.verification_url;

    Ok(DeviceCodeStart {
        device_code: device_response.device_code,
        verification_uri_complete: Some(format!("{verification_url}?user_code={user_code}")),
        user_code,

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Read the device-code error; verify the OAuth client is allowed to use the device flow and scopes are correct.

When it happens

Trigger: Thrown at crates/zeroclaw-providers/src/auth/gemini_oauth.rs:224 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/473ee39e4fb44d57. Report an issue: GitHub.