Skip to content

fix: activate custom provider after adding via configure#9213

Open
DOsinga wants to merge 1 commit into
mainfrom
fix/activate-custom-provider-6692
Open

fix: activate custom provider after adding via configure#9213
DOsinga wants to merge 1 commit into
mainfrom
fix/activate-custom-provider-6692

Conversation

@DOsinga
Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga commented May 14, 2026

After adding a custom provider through goose configure → Custom Providers → Add, the provider was saved to disk but not set as the active provider in config.yaml. Users had to separately navigate to "Configure Providers" to select it.

Now prompts the user to set the new provider as active immediately after creation, and if confirmed, writes GOOSE_PROVIDER and GOOSE_MODEL to config.yaml. If only one model was entered, it's auto-selected; if multiple, the user picks the default.

Closes #6692

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 551c1868a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Choose a reason for hiding this comment

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

P1 Badge Guard activation flow against empty model list

If the user enters only commas/spaces in the model prompt (e.g. ", ,"), the current validator still accepts it, models becomes empty after trimming/filtering, and this new activation path reaches the select("Which model should be the default?") call with zero items. In that case, activation fails at runtime after the provider has already been created, leaving users in a partial-success state. This regression is introduced by the new post-create activation logic and is triggered specifically when provider_config.models is empty.

Useful? React with 👍 / 👎.

After adding a custom provider through 'goose configure → Custom Providers →
Add', the provider was saved to disk but not set as the active provider in
config.yaml. Users had to separately navigate to 'Configure Providers' to
select it.

Now prompts the user to set the new provider as active immediately after
creation, and if confirmed, writes GOOSE_PROVIDER and GOOSE_MODEL to
config.yaml.

Closes #6692

Signed-off-by: Douwe Osinga <douwe@squareup.com>
@DOsinga DOsinga force-pushed the fix/activate-custom-provider-6692 branch from 551c186 to 1df2d3e Compare May 14, 2026 16:32
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1df2d3e4af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2112 to +2115
if let Ok(model) = cliclack::select("Which model should be the default?")
.items(&model_items)
.interact()
{
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

Copy link
Copy Markdown
Collaborator

@jh-block jh-block left a comment

Choose a reason for hiding this comment

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

one nit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config.yaml is not updated when using goose configure

2 participants