xai-org/grok-build · error

Not signed in. Run `grok login` to authenticate (or `grok lo

Error message

Not signed in. Run `grok login` to authenticate (or `grok login --device-code` if no browser is available).

What it means

Error "Not signed in. Run `grok login` to authenticate (or `grok login --device-code` if no browser is available)." thrown in xai-org/grok-build.

Source

Thrown at crates/codegen/xai-grok-pager/src/headless.rs:471

         Alternatively, set the XAI_API_KEY environment variable \
         or run `grok login` on a machine with a browser."
            .to_string()
    }
}

/// Authenticate via the agent's `defaultAuthMethodId`, failing closed when none is available.
/// Returns whether the selected method is API-key auth.
async fn authenticate(
    acp_tx: &AcpAgentTx,
    auths: &[acp::AuthMethod],
    default_auth_method_id: Option<&acp::AuthMethodId>,
) -> anyhow::Result<bool> {
    let method_id = crate::acp::select_eager_auth_method(auths, default_auth_method_id)
        .ok_or_else(|| {
            use std::io::IsTerminal;
            let interactive = std::io::stdin().is_terminal()
                && !xai_grok_shell::util::clipboard::is_remote_session();
            anyhow::anyhow!("{}", auth_required_message(interactive))
        })?;
    let kind = AuthMethodKind::from_id(&method_id);
    // Prefer non-interactive methods only; interactive login is not usable headless.
    if kind.needs_interactive_login() {
        use std::io::IsTerminal;
        let interactive =
            std::io::stdin().is_terminal() && !xai_grok_shell::util::clipboard::is_remote_session();
        anyhow::bail!("{}", auth_required_message(interactive));
    }
    let is_api_key_auth = kind.is_api_key();
    let _resp: acp::AuthenticateResponse = acp_send(
        acp::AuthenticateRequest::new(method_id)
            .meta(serde_json::json!({"headless": true}).as_object().cloned()),
        acp_tx,
    )
    .await?;
    Ok(is_api_key_auth)
}

View on GitHub (pinned to bc7f02eddd)

When it happens

Trigger: Thrown at crates/codegen/xai-grok-pager/src/headless.rs:471 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/79967dcf28a27844. Report an issue: GitHub.