Allow API Key users to select models directly when configured#52
Open
BingqingLyu wants to merge 2 commits into
Open
Allow API Key users to select models directly when configured#52BingqingLyu wants to merge 2 commits into
BingqingLyu wants to merge 2 commits into
Conversation
…ured When users select API Key auth option and have already configured models in modelProviders, open ModelDialog directly instead of just showing configuration instructions. This allows new users using custom API keys to complete authentication without going through OAuth or Coding Plan first. - Add openModelDialog to UIActionsContext - Check for configured USE_OPENAI models in AuthDialog - Keep AuthDialog open in background so users return to it after closing ModelDialog, ensuring unauthenticated users cannot skip auth Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
… auth - Add closeAuthDialog() to close AuthDialog via React state after successful model switch - Fix handleModelChange to call refreshAuth for initial auth (no contentGeneratorConfig) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This was referenced Apr 28, 2026
Owner
Author
Conflict Group 1This PR shares modified functions with 9 other PR(s): #100, #107, #109, #113, #114, #117, #46, #88, #96. These PRs should be reviewed as a batch — merging one may affect the others.
graph LR
PR52["PR #52"]
FModelDialog_7258["ModelDialog<br>ModelDialog.tsx"]
PR52 -->|modifies| FModelDialog_7258
PR46["PR #46"]
PR46 -->|modifies| FModelDialog_7258
FisToolExecuting_7261["isToolExecuting<br>AppContainer.tsx"]
PR52 -->|modifies| FisToolExecuting_7261
PR100["PR #100"]
PR100 -->|modifies| FisToolExecuting_7261
PR107["PR #107"]
PR107 -->|modifies| FisToolExecuting_7261
PR109["PR #109"]
PR109 -->|modifies| FisToolExecuting_7261
PR113["PR #113"]
PR113 -->|modifies| FisToolExecuting_7261
PR114["PR #114"]
PR114 -->|modifies| FisToolExecuting_7261
PR117["PR #117"]
PR117 -->|modifies| FisToolExecuting_7261
PR88["PR #88"]
PR88 -->|modifies| FisToolExecuting_7261
PR96["PR #96"]
PR96 -->|modifies| FisToolExecuting_7261
Posted by codegraph-ai conflict detection. |
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.
TLDR
Allow API Key users to select models directly when
modelProvidersare already configured. Previously, selecting "API Key" only showed static configuration instructions, forcing users to authenticate via OAuth or Coding Plan first.Dive Deeper
The authentication flow had a gap: users who configured their own API keys in
settings.jsoncouldn't complete authentication without first using OAuth or Coding Plan. The "API Key" option only displayed documentation links without actionable next steps.Changes made:
openModelDialogtoUIActionsContextto expose the model selection dialog to auth componentsAuthDialogto detect pre-configuredUSE_OPENAImodels when "API Key" is selectedModelDialogdirectly for immediate model selectionAuthDialogremains open in the background (via DialogManager's z-order), ensuring users return to authentication if they close the model dialog without completing authThis preserves the security requirement that unauthenticated users cannot skip auth, while allowing properly configured users to proceed directly to model selection.
Reviewer Test Plan
settings.jsonundermodelProviders.USE_OPENAI:{ "modelProviders": { "USE_OPENAI": [ { "id": "my-model", "label": "My Custom Model", "baseUrl": "https://api.example.com/v1", "envKey": "MY_API_KEY" } ] } }Set the environment variable:
export MY_API_KEY=your-api-keyStart Qwen Code without being authenticated
Select "API Key" authentication option
Expected: ModelDialog opens showing your configured model instead of just showing documentation
Select a model and verify authentication completes successfully
Edge case: Close ModelDialog without selecting a model - should return to AuthDialog
Testing Matrix
Linked issues / bugs