Skip to content

Commit

Permalink
fix agent tests model preferences state (#5828)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sqs authored Oct 5, 2024
1 parent 0ad1fcd commit 0b87153
Show file tree
Hide file tree
Showing 16 changed files with 410 additions and 988 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ interface CodyAgentServer {
fun chat_sidebar_new(params: Null?): CompletableFuture<Chat_Sidebar_NewResult>
@JsonRequest("chat/delete")
fun chat_delete(params: Chat_DeleteParams): CompletableFuture<List<ChatExportResult>>
@JsonRequest("chat/restore")
fun chat_restore(params: Chat_RestoreParams): CompletableFuture<String>
@JsonRequest("chat/models")
fun chat_models(params: Chat_ModelsParams): CompletableFuture<Chat_ModelsResult>
@JsonRequest("chat/export")
Expand Down
6 changes: 0 additions & 6 deletions agent/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,7 @@ shutdown: [null, null]
```ts
'chat/new': [null, string]
```
<h2 id="chat_restore"><a href="#chat_restore" name="chat_restore"><code>chat/restore</code> (<img class="emoji" title=":arrow_right:" alt=":arrow_right:" src="https://github.githubassets.com/images/icons/emoji/unicode/27a1.png" height="20" width="20">)</a></h2>
<p>Request sent from the client to client server.</p>


```ts
'chat/restore': [{ modelID: string; messages: AgentChatMessage[]; chatID: string; }, string]
```
<h2 id="chat_models"><a href="#chat_models" name="chat_models"><code>chat/models</code> (<img class="emoji" title=":arrow_right:" alt=":arrow_right:" src="https://github.githubassets.com/images/icons/emoji/unicode/27a1.png" height="20" width="20">)</a></h2>
<p>Request sent from the client to client server.</p>

Expand Down
Loading

0 comments on commit 0b87153

Please sign in to comment.