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

fix(models): ensure Tool Cody is only added when enabled #6753

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

abeatrix
Copy link
Contributor

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:

image

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.
@abeatrix abeatrix merged commit ae351c2 into main Jan 22, 2025
22 of 23 checks passed
@abeatrix abeatrix deleted the bee/fix-tool-cody branch January 22, 2025 16:09
umpox pushed a commit that referenced this pull request Jan 22, 2025
… when enabled (#6758)

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"
/>

 <br> Backport ae351c2 from #6753

Co-authored-by: Beatrix <[email protected]>
umpox pushed a commit that referenced this pull request Jan 22, 2025
…n enabled (#6759)

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&#39;t have the configuration in your settings:

&lt;img width=&quot;603&quot; alt=&quot;image&quot;
src=&quot;https://github.com/user-attachments/assets/6ebdbb6e-650d-4bc4-ad62-40a285a13f5f&quot;
/&gt;

 <br> Backport ae351c2 from #6753

Co-authored-by: Beatrix <[email protected]>
taiyab pushed a commit that referenced this pull request Jan 23, 2025
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"
/>
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.

2 participants