{"record":{"id":"473ee39e4fb44d57","repo":"zeroclaw-labs/zeroclaw","slug":"google-device-code-error","errorCode":null,"errorMessage":"Google device code error: {} - {}","messagePattern":"Google device code error: (.+?) - (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-providers/src/auth/gemini_oauth.rs","lineNumber":224,"sourceCode":"pub async fn start_device_code_flow(client: &Client, client_id: &str) -> Result<DeviceCodeStart> {\n    let form = [(\"client_id\", client_id), (\"scope\", GEMINI_OAUTH_SCOPES)];\n\n    let response = client\n        .post(GOOGLE_OAUTH_DEVICE_CODE_URL)\n        .form(&form)\n        .send()\n        .await\n        .context(\"Failed to start device code flow\")?;\n\n    let status = response.status();\n    let body = response\n        .text()\n        .await\n        .context(\"Failed to read device code response\")?;\n\n    if !status.is_success() {\n        if let Ok(err) = serde_json::from_str::<OAuthErrorResponse>(&body) {\n            anyhow::bail!(\n                \"Google device code error: {} - {}\",\n                err.error,\n                err.error_description.unwrap_or_default()\n            );\n        }\n        anyhow::bail!(\"Google device code request failed ({}): {}\", status, body);\n    }\n\n    let device_response: DeviceCodeResponse =\n        serde_json::from_str(&body).context(\"Failed to parse device code response\")?;\n\n    let user_code = device_response.user_code;\n    let verification_url = device_response.verification_url;\n\n    Ok(DeviceCodeStart {\n        device_code: device_response.device_code,\n        verification_uri_complete: Some(format!(\"{verification_url}?user_code={user_code}\")),\n        user_code,","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-providers/src/auth/gemini_oauth.rs#L206-L242","documentation":"Error \"Google device code error: {} - {}\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-providers/src/auth/gemini_oauth.rs:224 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the device-code error; verify the OAuth client is allowed to use the device flow and scopes are correct."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}