aaif-goose/goose · error

Failed to create provider for OAuth: {}

Error message

Failed to create provider for OAuth: {}

What it means

Before running the OAuth flow, goose instantiates the provider with `create(provider_name, Vec::new())`. If the provider cannot be constructed — unknown name, unsatisfied construction requirements, or a failure while fetching provider metadata — that construction error is wrapped with this message, so the OAuth flow is never even attempted.

Source

Thrown at crates/goose-cli/src/commands/configure.rs:468

    // Create a temporary provider instance to handle OAuth
    match create(provider_name, Vec::new()).await {
        Ok(provider) => match provider.configure_oauth().await {
            Ok(_) => {
                let _ = cliclack::log::success("OAuth authentication completed successfully!");
                Ok(())
            }
            Err(e) => {
                let _ = cliclack::log::error(format!("Failed to authenticate: {}", e));
                Err(anyhow::anyhow!(
                    "OAuth authentication failed for {}: {}",
                    key_name,
                    e
                ))
            }
        },
        Err(e) => {
            let _ = cliclack::log::error(format!("Failed to create provider for OAuth: {}", e));
            Err(anyhow::anyhow!(
                "Failed to create provider for OAuth: {}",
                e
            ))
        }
    }
}

const UNLISTED_MODEL_KEY: &str = "__unlisted__";

fn interactive_model_search(
    models: &[String],
    provider_meta: &goose::providers::base::ProviderMetadata,
) -> anyhow::Result<String> {
    const MAX_VISIBLE: usize = 30;
    let mut query = String::new();

    loop {
        let _ = cliclack::clear_screen();

View on GitHub (pinned to 3810898a74)

Solutions

  1. Check the embedded error text for the construction failure reason
  2. Verify the provider id against the list offered by `goose configure`/docs
  3. Fix network egress/proxy if the constructor fetches remote metadata, then retry
  4. Update goose — provider registration regressions are typically fixed quickly
Defensive patterns

Strategy: validation

Validate before calling

// Rust: prove the provider is constructible before offering OAuth
let provider = create(provider_name, Vec::new())
    .await
    .map_err(|e| anyhow::anyhow!("provider unavailable before OAuth: {e}"))?;

Prevention

When it happens

Trigger: `goose configure` -> OAuth for a provider whose factory call fails: provider id not recognized in this build, or the provider constructor erroring during initialization (e.g. fetching remote model metadata).

Common situations: Typos or renamed provider ids; custom builds with some providers compiled out; constructors that call the network failing behind proxies; version drift between saved config and the binary.

Related errors


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/22cd7f3a8bb955a7. Report an issue: GitHub.