fix: replace unreachable!() with error return in setup wizard

The provider match in step_inference_provider was guarded by
is_known but used unreachable!() as the catch-all. If a new
provider is added to the is_known check without a corresponding
match arm, this would panic at runtime. Return a typed error
instead.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
Illia Polosukhin
2026-02-14 13:51:37 -08:00
co-authored by Claude Opus 4.6
parent da47903108
commit 1885d61d46
+6 -1
View File
@@ -605,7 +605,12 @@ impl SetupWizard {
"openai" => return self.setup_openai().await,
"ollama" => return self.setup_ollama(),
"openai_compatible" => return self.setup_openai_compatible().await,
_ => unreachable!(),
_ => {
return Err(SetupError::Config(format!(
"Unhandled provider: {}",
current
)));
}
}
}