Hmbown/CodeWhale · error · anyhow::Error
model ` ` is available from configured provider route(s): …
Error message
model `{model}` is available from configured provider route(s): {providers}. Pass `--provider <provider>` with `--model {model}` to choose one explicitly. In the TUI, use `/provider`, `/model`, or `/setup` to resolve the route before sending. What it means
The requested `--model` is resolvable but ambiguous: more than one configured provider route can serve it, and no provider was pinned. The CLI refuses to guess which route to use and lists the candidate providers, asking for an explicit `--provider` (or in-TUI route selection) before sending.
Solutions
- Add `--provider <provider>` choosing one of the providers listed in the message.
- In the TUI, resolve the route with `/provider`, `/model`, or `/setup` before sending.
- Remove or rename the duplicate model entry in one provider's config if the ambiguity is unintended.
Example fix
// before codewhale ask --model k3 // after codewhale ask --model k3 --provider moonshot
Defensive patterns
Strategy: validation
Validate before calling
const providers = configuredProvidersForModel(model);
if (providers.length > 1 && !providerFlag) throw new Error(`ambiguous model ${model}: ${providers.join(",")}`);
Try / catch
match resolve_route(model, provider_arg) {
Err(e) if e.to_string().contains("available from configured provider route") => {
// prompt user to pick a provider, then retry with --provider
}
other => other?,
}
Prevention
- Pin --provider in scripts whenever more than one provider is configured.
- Resolve routes once in the TUI with /setup so one-shot calls stay unambiguous.
- Avoid configuring the same model id under two providers unless aliases are intentional.
When it happens
Trigger: Invoking a one-shot model command with `--model <model>` while `candidate_providers.len() > 1` and no `--provider` flag was supplied.
Common situations: Two providers configured (e.g. two API endpoints offering the same model id, or an alias expansion matching several registries) after adding a second provider in /setup.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- Antigravity is a retired, non-runnable legacy provider…
- invalid value ' ' for '--provider ': expected one of …
- ` ` is not a valid provider id. Ids are 1-64 characters of…
- {LEGACY_ANTIGRAVITY_TOMBSTONE_MESSAGE}
- ` ` is not a provider this Codewhale account can connect…
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/cdafd8782ca7188e.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/lib.rs:11667
);
return Ok(CliAutoRoute {
provider: selection.provider,
model: selection.model,
reasoning_effort: selection.reasoning_effort,
auto_controls_reasoning,
auto_model: false,
});
}
let candidate_providers = model_routing::explicit_route_candidate_providers(config, model);
if !candidate_providers.is_empty() && !candidate_providers.contains(&config.api_provider())
{
let providers = candidate_providers
.iter()
.map(|provider| provider.as_str())
.collect::<Vec<_>>()
.join(", ");
bail!(
"model `{model}` is available from configured provider route(s): {providers}. \
Pass `--provider <provider>` with `--model {model}` to choose one explicitly. \
In the TUI, use `/provider`, `/model`, or `/setup` to resolve the route before sending."
);
}
// When --model is not `auto`, fall back to the reasoning_effort
// declared in the user's config.toml. The previous hard-coded `None`
// silently dropped the user's setting on every non-auto-route exec
// call, which (for example) prevented vllm + Qwen3 users from
// disabling thinking via `reasoning_effort = "off"` and caused
// 30+ second SSE idle timeouts on trivial prompts.
let reasoning_effort = config
.reasoning_effort()
.map(crate::reasoning_preference::ReasoningEffort::from_setting);
Ok(CliAutoRoute {
provider: config.api_provider(),
model: model.to_string(),View on GitHub (pinned to 73e0f67d83)