diff --git a/crates/goose-cli/src/commands/configure.rs b/crates/goose-cli/src/commands/configure.rs index 059f4b68efd1..e0a05c023c7e 100644 --- a/crates/goose-cli/src/commands/configure.rs +++ b/crates/goose-cli/src/commands/configure.rs @@ -1529,7 +1529,17 @@ pub async fn handle_openrouter_auth() -> Result<(), Box> { // Test configuration - get the model that was configured println!("\nTesting configuration..."); let configured_model: String = config.get_param("GOOSE_MODEL")?; - let model_config = goose::model::ModelConfig::new(configured_model); + let model_config = match goose::model::ModelConfig::new(&configured_model) { + Ok(config) => config, + Err(e) => { + eprintln!("⚠️ Invalid model configuration: {}", e); + eprintln!( + "Your settings have been saved. Please check your model configuration." + ); + return Ok(()); + } + }; + match create("openrouter", model_config) { Ok(provider) => { // Simple test request