Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code: Patch Release 1.16.7 #4121

Closed
wants to merge 7 commits into from
Closed

VS Code: Patch Release 1.16.7 #4121

wants to merge 7 commits into from

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented May 9, 2024

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, the selectedModel is derived from the models 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 the model parameter when checking for the codyProOnly condition and sending the telemetry event, which is still set as the initial value.

Fixes:

  1. Update model selection condition: The condition for showing the Cody Pro badge and redirecting to the subscription page has been updated. Instead of checking the codyProOnly property of the selectedModel, it now checks the codyProOnly property of the model param being selected.
  2. Update event properties: The LLM_provider property in the CodyVSCodeExtension:chooseLLM:clicked event is now set to the model.model value instead of selectedModel.model.
  3. Optimize dependency array: The dependency array for the onModelSelect callback has been updated to remove the selectedModel 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

  1. Start Cody dev from this branch
  2. Sign into to Cody with Free user
  3. Open a new chat and choose any other LLM
  4. Verify clicking on Pro only model will open the subscription page in your browser
Screen.Recording.2024-05-09.at.12.10.12.PM.mov

@abeatrix abeatrix changed the base branch from main to v1.16.4 May 9, 2024 19:31
@abeatrix abeatrix marked this pull request as draft May 9, 2024 19:38
@abeatrix abeatrix mentioned this pull request May 9, 2024
@abeatrix abeatrix requested a review from a team May 9, 2024 20:31
@abeatrix
Copy link
Contributor Author

published

@abeatrix abeatrix closed this May 10, 2024
sqs added a commit that referenced this pull request May 10, 2024
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.

None yet

2 participants