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.
BRANCH OFF v1.16.6 - DO NOT MERGE TO MAIN
This pull request updates the logic for selecting a model in the
ModelSelectField
component to fix an issue where clicking on a non-default model on first click does not work as expected.Issue:
In the
ModelSelectField
component, theselectedModel
is derived from themodels
prop and represents the default model which everyone has access to.The
onModelSelect
callback function is responsible for handling the selection of a new model. When a user clicks on a different model in the dropdown, this callback function is called with the newly selected model as a parameter.The issue arose because the onModelSelect callback was using the
selectedModel
instead of themodel
parameter when checking for thecodyProOnly
condition and sending the telemetry event, which is still set as the initial value.Fixes:
codyProOnly
property of theselectedModel
, it now checks thecodyProOnly
property of themodel
param being selected.LLM_provider
property in theCodyVSCodeExtension:chooseLLM:clicked
event is now set to themodel.model
value instead ofselectedModel.model
.onModelSelect
callback has been updated to remove theselectedModel
dependency, as it is no longer used.These changes ensure that the Cody Pro badge and subscription link are displayed correctly when selecting a Cody Pro-only model.
Test plan
Screen.Recording.2024-05-09.at.12.10.12.PM.mov