Hmbown/CodeWhale · error
external xAI/Grok credential file not found at {}
Error message
external xAI/Grok credential file not found at {} What it means
Raised in load_external_auth_file when the external Grok CLI credential file granted for reading does not exist at the expected path (typically ~/.grok/... referenced by the read grant). This sentinel guard fires when external credential borrowing is enabled but the source CLI has never logged in on this machine.
Source
Thrown at crates/tui/src/xai_oauth.rs:814
};
parse_auth_file(&raw, path).map(Some)
}
fn load_owned_auth_file_from_store(
store: &codewhale_config::XaiOAuthCredentialStore,
name: &str,
) -> Result<Option<AuthFile>> {
let Some(raw) = store.read_to_string(name)? else {
return Ok(None);
};
parse_auth_file(&raw, &store.path_for(name)?).map(Some)
}
fn load_external_auth_file(
grant: &codewhale_config::ExternalCredentialReadGrant,
) -> Result<AuthFile> {
let Some(raw) = crate::external_credentials::read_to_string(grant)? else {
bail!(
"external xAI/Grok credential file not found at {}",
codewhale_config::quote_os_path(grant.path())
);
};
parse_auth_file(&raw, grant.path())
}
fn parse_auth_file(raw: &str, path: &Path) -> Result<AuthFile> {
let value: Value = serde_json::from_str(raw).map_err(|_| {
anyhow::anyhow!(
"xAI/Grok credential file {} is not valid credential JSON",
codewhale_config::quote_os_path(path)
)
})?;
let obj = value.as_object().ok_or_else(|| {
anyhow::anyhow!(
"xAI/Grok credential file {} must be a JSON object of entries",
codewhale_config::quote_os_path(path)View on GitHub (pinned to 0c42157ee5)
Solutions
- Run `grok login` to create the external credential file
- Use `codewhale auth xai-device` to create owned credentials instead of borrowing
- Check the path in the error message and the external credential read grant configuration
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/tui/src/xai_oauth.rs:814 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20).
Data as JSON: /api/errors/e93ff2bd6056d35a.
Report an issue: GitHub.