Hmbown/CodeWhale · error

--provider is required in --non-interactive mode. Known: {}

Error message

--provider is required in --non-interactive mode. Known: {}

What it means

Remote setup resolves the model provider from --provider, an interactive prompt, or fails. In --non-interactive mode an omitted --provider is a hard error because there is no safe default across ProviderKind values. The message lists the known provider names via ProviderKind::names_hint().

Source

Thrown at crates/tui/src/remote_setup/mod.rs:195

        &BRIDGES
            .iter()
            .map(|b| format!("{} ({})", b.display, b.slug))
            .collect::<Vec<_>>(),
    )?;
    Ok(&BRIDGES[idx])
}

fn resolve_provider(args: &RemoteSetupArgs) -> Result<ProviderInfo> {
    if let Some(slug) = &args.provider {
        return ProviderInfo::from_slug(slug).ok_or_else(|| {
            anyhow::anyhow!(
                "unknown provider '{slug}'. Known: {}",
                codewhale_config::ProviderKind::names_hint()
            )
        });
    }
    if args.non_interactive {
        bail!(
            "--provider is required in --non-interactive mode. Known: {}",
            codewhale_config::ProviderKind::names_hint()
        );
    }
    // List providers by their canonical names from the existing registry.
    let providers: Vec<ProviderInfo> = codewhale_config::ProviderKind::all()
        .iter()
        .filter_map(|kind| ProviderInfo::from_slug(kind.as_str()))
        .collect();
    let labels: Vec<String> = providers
        .iter()
        .map(|p| format!("{} ({})", p.display, p.slug))
        .collect();
    let idx = prompt_choice("Model provider", &labels)?;
    Ok(providers[idx].clone())
}

fn cloud_choices() -> String {

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Add --provider <slug> to the command, choosing from the names printed by the error (ProviderKind::names_hint()).
  2. Run interactively once to see the provider list and pick a value, then bake that slug into the non-interactive invocation.
  3. If the slug is rejected as unknown, check the release notes for renamed ProviderKind values and update the flag.

Example fix

# before
codewhale remote-setup --non-interactive --cloud <slug> --bridge <slug>
# fails: --provider is required in --non-interactive mode

# after
codewhale remote-setup --non-interactive --cloud <slug> --bridge <slug> --provider <slug>
Defensive patterns

Strategy: validation

Validate before calling

# Shell: require provider for non-interactive setup
: "${CODEWHALE_PROVIDER:?--provider is required in --non-interactive mode; set CODEWHALE_PROVIDER}"
codewhale remote-setup --non-interactive --cloud "$CODEWHALE_CLOUD" --bridge "$CODEWHALE_BRIDGE" --provider "$CODEWHALE_PROVIDER"

Prevention

When it happens

Trigger: Running remote setup with --non-interactive and no --provider argument in resolve_provider (crates/tui/src/remote_setup/mod.rs). An unrecognized slug triggers the separate 'unknown provider' error.

Common situations: CI provisioning pipelines that migrated from interactive setup; renamed or newly added provider kinds whose slugs changed between versions; command templates copied from docs that assume a provider default.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/3be73bda760ce654. Report an issue: GitHub.