{"record":{"id":"d43b46cbfff2995d","repo":"Hmbown/CodeWhale","slug":"codewhale-owned-xai-oauth-credentials-were-not-fou","errorCode":null,"errorMessage":"Codewhale-owned xAI OAuth credentials were not found at {}. Run `codewhale auth xai-device` again.","messagePattern":"Codewhale-owned xAI OAuth credentials were not found at (.+?)\\. Run `codewhale auth xai-device` again\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/xai_oauth.rs","lineNumber":438,"sourceCode":"            || codewhale_config::is_valid_xai_oauth_generation(name),\n        \"Codewhale-owned xAI OAuth path has an invalid basename\"\n    );\n    codewhale_config::with_xai_oauth_lifecycle_lock(|store| {\n        get_owned_credentials_locked(store, name, refresh_access_token)\n    })\n}\n\nfn get_owned_credentials_locked<F>(\n    store: &codewhale_config::XaiOAuthCredentialStore,\n    name: &str,\n    refresh_access: F,\n) -> Result<XaiOAuthCredentials>\nwhere\n    F: FnOnce(&str, &str, &str) -> Result<TokenResponse>,\n{\n    let path = store.path_for(name)?;\n    let mut file = load_owned_auth_file_from_store(store, name)?.ok_or_else(|| {\n        anyhow::anyhow!(\n            \"Codewhale-owned xAI OAuth credentials were not found at {}. Run `codewhale auth xai-device` again.\",\n            codewhale_config::quote_os_path(&path)\n        )\n    })?;\n    let (scope, mut entry) = select_entry(&mut file).ok_or_else(|| {\n        anyhow::anyhow!(\n            \"Codewhale-owned xAI OAuth credentials at {} have no usable entry. Run `codewhale auth xai-device` again.\",\n            codewhale_config::quote_os_path(&path)\n        )\n    })?;\n\n    if entry_access_token_is_fresh(&entry) {\n        let token = entry\n            .key\n            .clone()\n            .filter(|t| !t.trim().is_empty())\n            .context(\"xAI OAuth access token is empty\")?;\n        return Ok(credentials_from_entry(scope, &entry, token));","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/xai_oauth.rs#L420-L456","documentation":"Missing-credential error in get_owned_credentials_locked: the Codewhale-owned xAI OAuth auth file does not exist at the expected store path, so load_owned_auth_file_from_store returned None. The device-login flow was never completed or the file was deleted.","triggerScenarios":"Thrown at crates/tui/src/xai_oauth.rs:438 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `codewhale auth xai-device` again to perform a fresh device login and recreate the credential file.","Check that the credential file at the quoted path was not deleted by cleanup jobs or manual intervention."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}