From 1885d61d467fc4b84c435156555703ea9a1aba15 Mon Sep 17 00:00:00 2001 From: Illia Polosukhin Date: Sat, 14 Feb 2026 13:51:37 -0800 Subject: [PATCH] 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 --- src/setup/wizard.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/setup/wizard.rs b/src/setup/wizard.rs index b3860729..1e465205 100644 --- a/src/setup/wizard.rs +++ b/src/setup/wizard.rs @@ -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 + ))); + } } }