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

[Backport jb-v7.12.x] fix(models): ensure Tool Cody is only added when enabled #6759

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

sourcegraph-release-bot
Copy link
Collaborator

FIX https://linear.app/sourcegraph/issue/CODY-4737

The issue was that the Tool Cody model was being added to the list of primary models regardless of whether the feature was enabled or not. The root cause was that the check for the existence of the Tool Cody model was not properly scoped to the isToolCodyEnabled flag but was checking the observable instead, which would always returns true as the observable is defined.

This change fixes the issue by only adding the Tool Cody model to the list of primary models if the isToolCodyEnabled flag is true and the Tool Cody model is not already present in the list of primary models.

Included some minor clean up.

Test plan

Verify Tool Cody is not showing up in your model dropdown if you don't have the configuration in your settings:

<img width="603" alt="image" src="https://github.com/user-attachments/assets/6ebdbb6e-650d-4bc4-ad62-40a285a13f5f" />


Backport ae351c2 from #6753

FIX https://linear.app/sourcegraph/issue/CODY-4737

The issue was that the Tool Cody model was being added to the list of
primary models regardless of whether the feature was enabled or not. The
root cause was that the check for the existence of the Tool Cody model
was not properly scoped to the `isToolCodyEnabled` flag but was checking
the observable instead, which would always returns true as the
observable is defined.

This change fixes the issue by only adding the Tool Cody model to the
list of primary models if the `isToolCodyEnabled` flag is true and the
Tool Cody model is not already present in the list of primary models.

Included some minor clean up.

## Test plan

<!-- Required. See
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles.
-->

Verify Tool Cody is not showing up in your model dropdown if you don't
have the configuration in your settings:

<img width="603" alt="image"
src="https://github.com/user-attachments/assets/6ebdbb6e-650d-4bc4-ad62-40a285a13f5f"
/>

(cherry picked from commit ae351c2)
@umpox umpox merged commit 60bbda0 into jb-v7.12.x Jan 22, 2025
23 checks passed
@umpox umpox deleted the backport-6753-to-jb-v7.12.x branch January 22, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants