xai-org/grok-build · error

No auth methods available

Error message

No auth methods available

What it means

authenticate could not find any usable auth method: select_eager_auth_method returned None because the ACP agent advertised no auth methods and no default_auth_method_id fallback was available. The library throws this to abort eager authentication before calling the agent's authenticate RPC.

Source

Thrown at crates/codegen/xai-grok-pager/src/acp/mod.rs:798

            None,
        ),
    }
}

/// Authenticate with the agent using the agent's chosen default method.
///
/// Prefer `defaultAuthMethodId` from initialize meta when present and listed.
/// Do not re-derive api_key vs session ordering client-side (that has regressed OIDC refresh before).
/// Legacy fallback: `cached_token` then first method.
///
/// Returns the response `meta` (contains `team_name`, etc.) so callers can propagate it to the UI.
async fn authenticate(
    tx: &AcpAgentTx,
    auth_methods: &[acp::AuthMethod],
    default_auth_method_id: Option<&acp::AuthMethodId>,
) -> Result<Option<serde_json::Value>> {
    let method_id = select_eager_auth_method(auth_methods, default_auth_method_id)
        .ok_or_else(|| anyhow::anyhow!("No auth methods available"))?;
    crate::unified_log::info(
        "pager eager auth method selected",
        None,
        Some(serde_json::json!({
            "method_id": method_id.0.as_ref(),
            "from_default_auth_method_id": default_auth_method_id
                .is_some_and(|d| d.0.as_ref() == method_id.0.as_ref()),
            "methods_count": auth_methods.len(),
            "first_method": auth_methods.first().map(|m| m.id().0.as_ref()),
        })),
    );

    let resp: acp::AuthenticateResponse =
        acp_send(acp::AuthenticateRequest::new(method_id), tx).await?;
    Ok(resp.meta.map(serde_json::Value::Object))
}

/// Pick the method id for eager authenticate.

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Check why the agent advertised zero auth methods (agent logs, backend auth status)
  2. Provide a default_auth_method_id so select_eager_auth_method has a fallback
  3. Run the interactive login flow (login fallback) instead of eager auth
  4. Verify agent/client ACP protocol versions agree on auth method advertisement

Example fix

// before
let value = authenticate(&tx, &auth_methods, None).await?;
// after
match authenticate(&tx, &auth_methods, default_auth_method_id.as_ref()).await {
    Ok(value) => value,
    Err(e) if e.to_string().contains("No auth methods") => login_fallback(&tx).await?,
    Err(e) => return Err(e),
}
Defensive patterns

Strategy: fallback

Validate before calling

fn can_eager_auth(methods: &[acp::AuthMethod], default_id: Option<&acp::AuthMethodId>) -> bool {
    !methods.is_empty() || default_id.is_some()
}
// if false, go straight to interactive login

Try / catch

match authenticate(&tx, &methods, default.as_ref()).await {
    Ok(v) => Ok(Some(v)),
    Err(e) if e.to_string().contains("No auth methods available") => login_fallback(&tx).await,
    Err(e) => Err(e),
}

Prevention

When it happens

Trigger: Calling authenticate (via eager_auth_or_login_fallback) when the agent's newSession/authenticate response contains an empty authMethods list and default_auth_method_id is None.

Common situations: Agent not logged in and exposing no auth methods, misconfigured agent backend, API version mismatch where auth method advertisement changed, expired credentials causing the agent to drop its method list.

Related errors


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