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 agent tests model preferences state #5828

Merged
merged 3 commits into from
Oct 5, 2024
Merged

Conversation

sqs
Copy link
Member

@sqs sqs commented Oct 5, 2024

In the agent tests, the testing/reset command was not entirely resetting
the state between tests. This meant that 2 tests (explain and smell) that
performed explicit chat/setModel requests to change the model to Mixtral but
were (incorrectly) running with the chat model used for the previous tests.

The reason is that testing/reset just cleared the in-memory
LocalStorageProvider backing Map and did not cause
LocalStorageProvider to fire a change event, which is necessary for the
ModelsService to know that the models preferences changed.

Also clean up types.

Test plan

Agent tests

Also `console.debug` is not supported everywhere, so just use `console.log`.
In the agent tests, the `testing/reset` command was not entirely resetting the state between tests. This meant that 2 tests (explain and smell) that performed explicit `chat/setModel` requests to change the model to Mixtral were running with the chat model used for the previous tests.

The reason is that `testing/reset` just cleared the in-memory `LocalStorageProvider` backing `Map` and did not cause `LocalStorageProvider` to fire a change event, which is necessary for the `ModelsService` to know that the models preferences changed.

Also clean up types.
@sqs sqs requested a review from a team October 5, 2024 20:53
@sqs sqs merged commit 0b87153 into main Oct 5, 2024
21 checks passed
@sqs sqs deleted the sqs/fix-agent-models-prefs branch October 5, 2024 21:13
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.

2 participants