Hmbown/CodeWhale · error
unknown provider ' '. Known
Error message
unknown provider '{slug}'. Known: {} What it means
resolve_provider resolves the --provider flag via ProviderInfo::from_slug and, when the slug matches no known provider kind, throws listing the known provider names from codewhale_config::ProviderKind::names_hint().
Solutions
- Use one of the names from the 'Known:' list in the error message
- Omit --provider to choose interactively
- Check codewhale_config::ProviderKind::names_hint() for the exact accepted names
- Fix casing — slugs are matched exactly
Example fix
// before codewhale remote-setup --provider z.ai-grok // after codewhale remote-setup --provider zai
Defensive patterns
Strategy: validation
Validate before calling
if let Some(slug) = &args.provider {
if codewhale_config::ProviderKind::from_name(slug).is_none() {
eprintln!("--provider must be one of: {}",
codewhale_config::ProviderKind::names_hint());
std::process::exit(2);
}
} Try / catch
if let Err(e) = run_remote_setup(args) {
if e.to_string().starts_with("unknown provider") {
eprintln!("{e}");
std::process::exit(2);
}
return Err(e);
} Prevention
- Use exactly the names from names_hint() — case-sensitive
- Never pass provider display names where slugs are expected
- Prune removed providers from scripts after upgrades
- Validate flags at script start with a dry check
When it happens
Trigger: Running remote setup with `--provider <slug>` where the slug is not a valid provider kind name (misspelling, wrong case, unknown provider).
Common situations: Typos like `--provider anthropc`, using display names instead of slugs, or scripts referencing removed providers.
Understand the failure class
Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.
Related errors
- ` ` is not a valid provider id. Ids are 1-64 characters of…
- ` ` is not a provider this Codewhale account can connect…
- unknown bridge ' '.
- unknown cloud ' '.
- A positive pull request number is required
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/2b4b93a1fd3ea0b2.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/remote_setup/mod.rs:188
bail!(
"--bridge is required in --non-interactive mode. {}",
bridge_choices()
);
}
let idx = prompt_choice(
"Chat bridge",
&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()View on GitHub (pinned to 73e0f67d83)