fix(cli): only prompt for API keys the active config references#3945
Merged
Conversation
promptMissingKeys walked every preset provider, so a fresh DeepSeek-only install asked for MIMO_API_KEY on each launch — confusing enough that users assumed they had installed the wrong tool (#3939). Restrict the prompt to providers named by default_model, planner_model, and the subagent model settings. Merely-available presets stay silent; the chat banner still warns when a user switches to a model whose key is missing, and setup's explicit provider selection is unchanged. Closes #3939
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fresh DeepSeek-only install prompted for
MIMO_API_KEYon every launch, becausepromptMissingKeyswalked all preset providers (config.Default()ships deepseek-flash/pro + mimo-pro/flash) instead of the ones the session can actually use. Users assumed they'd installed the wrong tool (#3939, discussion #3920).providersWithMissingKeysnow restricts the prompt to providers referenced bydefault_model,[agent].planner_model, and the subagent model settings:DEEPSEEK_API_KEY, never for Mimo.planner_model = "mimo-pro"→MIMO_API_KEYis prompted, as before.configureKeysover the user's picks) is unchanged, and the chat banner still warns when the active model's key is missing.Tests cover both directions (unreferenced preset silent, referenced planner prompted).
Closes #3939