aaif-goose/goose · error

Provider '{}' not found. Available: {}

Error message

Provider '{}' not found. Available: {}

What it means

GOOSE_TEST_PROVIDER is set, and goose scenario runner matched it (case-insensitively) against the provider names returned by get_provider_configs() and found nothing. The error message deliberately includes the full list of valid provider names so you can correct the env var.

Source

Thrown at crates/goose-cli/src/scenario_tests/scenario_runner.rs:62

    }
}

pub async fn run_scenario<F>(
    test_name: &str,
    message_generator: MessageGenerator<'_>,
    providers_to_skip: Option<&[&str]>,
    validator: F,
) -> Result<()>
where
    F: Fn(&ScenarioResult) -> Result<()> + Send + Sync + 'static,
{
    if let Ok(only_provider) = std::env::var("GOOSE_TEST_PROVIDER") {
        let active_providers = get_provider_configs();
        let config = active_providers
            .iter()
            .find(|c| c.name.to_lowercase() == only_provider.to_lowercase())
            .ok_or_else(|| {
                anyhow::anyhow!(
                    "Provider '{}' not found. Available: {}",
                    only_provider,
                    get_provider_configs()
                        .iter()
                        .map(|c| c.name)
                        .collect::<Vec<_>>()
                        .join(", ")
                )
            })?;

        println!("Running test '{}' for provider: {}", test_name, config.name);
        run_provider_scenario_with_validation(config, test_name, &message_generator, &validator)
            .await?;
        return Ok(());
    }

    let excluded_providers: HashSet<_> = providers_to_skip
        .into_iter()

View on GitHub (pinned to 3810898a74)

Solutions

  1. Read the 'Available: ...' list in the error and set GOOSE_TEST_PROVIDER to one of those exact names.
  2. Unset the variable to run across all configured providers instead.
  3. If you expected a provider to exist, check your goose provider configuration (goose configure) so it appears in get_provider_configs().

Example fix

# before
$ GOOSE_TEST_PROVIDER=gpt4 cargo test -p goose-cli scenario
Error: Provider 'gpt4' not found. Available: openai, anthropic, google

# after
$ GOOSE_TEST_PROVIDER=openai cargo test -p goose-cli scenario
Defensive patterns

Strategy: validation

Validate before calling

# bash: validate against the same config list before running
avail=$(grep -oP 'name\s*=\s*"\K[^"]+' crates/goose-cli/src/scenario_tests/provider_config.rs | tr '\n' ',')
[[ ",${avail}," == *",${GOOSE_TEST_PROVIDER,,},"* ]] || unset GOOSE_TEST_PROVIDER

Try / catch

if let Err(e) = run_scenario(...).await {
    if e.to_string().starts_with("Provider '") {
        // fix GOOSE_TEST_PROVIDER using the names listed in the error
    }
}

Prevention

When it happens

Trigger: Running scenario tests with GOOSE_TEST_PROVIDER=openai when the config set names providers differently (e.g. 'openai-gpt-4o', 'anthropic'), or the var was left set from an older branch where provider names changed.

Common situations: Provider config renamed between goose versions; copy-pasted test commands from docs referencing stale provider names; shell profiles exporting the var permanently.

Related errors


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