Fixes GitKraken AI model selection showing 'No models found'#5038
Open
shoaib-fixes wants to merge 1 commit intogitkraken:mainfrom
Open
Fixes GitKraken AI model selection showing 'No models found'#5038shoaib-fixes wants to merge 1 commit intogitkraken:mainfrom
shoaib-fixes wants to merge 1 commit intogitkraken:mainfrom
Conversation
…itkraken#4963 - Removes silent error swallowing in GitKrakenProvider.getModels() — errors now propagate so callers can handle them - Checks for a valid auth token (getApiKey) before making the API request, returning [] early if unauthenticated - Passes the access token explicitly to getGkHeaders() instead of relying on the internal lookup that threw AuthenticationRequiredError silently - Adds null guard for result.data to handle missing/null API response fields - Removes leftover debugger statement - Catches getModels() errors in showAIModelPicker and shows 'Unable to load models' with the error description instead of the generic 'No models found' - Adds defensive try/catch in getOrUpdateModel for getModels() call used to restore a previously configured model
32ec7ac to
f708219
Compare
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.
Fixes #4963
Description
When selecting the GitKraken AI provider in the Switch AI Provider/Model... picker, the model dropdown was always empty when selecting copilot as the provider. Tracked it down to
GitKrakenProvider.getModels()— the whole method body was wrapped in a try/catch that silently returned[]on any error (auth failures, HTTP errors, bad responses). There was no way to tell whether models just didn't exist or something had actually gone wrong.GitKrakenProvider.getModels()— errors now propagate so callers can handle themgetApiKeybefore making the API request, returning[]early if unauthenticatedgetGkHeaders()instead of relying on the internal lookup that could throwAuthenticationRequiredErrorsilentlyresult.datato handle missing/null API response fieldsdebuggerstatementgetModels()errors inshowAIModelPickerand shows 'Unable to load models' with the error description instead of the generic 'No models found'getOrUpdateModelaround thegetModels()call used to restore a previously configured model at startupScreenshots showing model selection from copilot:
Checklist
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses