fix: remove Option from model listing return types, propagate errors (#7074)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Adrian Cole
2026-02-09 08:03:10 +08:00
committed by GitHub
parent 4e87011981
commit 08b89ca66b
27 changed files with 177 additions and 218 deletions
+3 -3
View File
@@ -691,15 +691,15 @@ pub async fn configure_provider_dialog() -> anyhow::Result<bool> {
};
spin.stop(style("Model fetch complete").green());
// Select a model: on fetch error show styled error and abort; if Some(models), show list; if None, free-text input
// Select a model: on fetch error show styled error and abort; if models available, show list; otherwise free-text input
let model: String = match models_res {
Err(e) => {
// Provider hook error
cliclack::outro(style(e.to_string()).on_red().white())?;
return Ok(false);
}
Ok(Some(models)) => select_model_from_list(&models, provider_meta)?,
Ok(None) => {
Ok(models) if !models.is_empty() => select_model_from_list(&models, provider_meta)?,
Ok(_) => {
let default_model =
std::env::var("GOOSE_MODEL").unwrap_or(provider_meta.default_model.clone());
cliclack::input("Enter a model from that provider:")