Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion crates/goose-cli/src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,7 @@ fn collect_custom_headers() -> anyhow::Result<Option<std::collections::HashMap<S
}

fn add_provider() -> anyhow::Result<()> {
let config = Config::global();
let provider_type = cliclack::select("What type of API is this?")
.item(
"openai_compatible",
Expand Down Expand Up @@ -2089,7 +2090,7 @@ fn add_provider() -> anyhow::Result<()> {

let headers = collect_custom_headers()?;

create_custom_provider(CreateCustomProviderParams {
let provider_config = create_custom_provider(CreateCustomProviderParams {
engine: provider_type.to_string(),
display_name: display_name.clone(),
api_url,
Expand All @@ -2102,6 +2103,21 @@ fn add_provider() -> anyhow::Result<()> {
base_path,
})?;

if !provider_config.models.is_empty() {
let model_items: Vec<_> = provider_config
.models
.iter()
.map(|m| (m.name.as_str(), m.name.as_str(), ""))
.collect();
if let Ok(model) = cliclack::select("Which model should be the default?")
.items(&model_items)
.interact()
{
Comment on lines +2112 to +2115
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate model-selection failures during activation

The new activation step silently ignores any error from select(...).interact() by using if let Ok(model), so cancellation/interrupts (for example Esc/Ctrl+C) or terminal I/O errors now fall through to a successful Custom provider added outro without writing GOOSE_PROVIDER/GOOSE_MODEL. This creates a partial-success state introduced by this commit: provider creation succeeds, but activation may be skipped with no feedback. Please handle the error path explicitly (or propagate it) so users don’t get a false success signal.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, it silently didn't activate before, so this is no worse. up to you whether to deal with this

config.set_goose_provider(&provider_config.name)?;
config.set_goose_model(model)?;
}
}

cliclack::outro(format!("Custom provider added: {}", display_name))?;
Ok(())
}
Expand Down
Loading