Skip to content

Commit

Permalink
Make local embedding startup lazier in sidebar chats.
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiccooney committed Dec 5, 2023
1 parent 013b209 commit 3b18f6a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vscode/src/chat/chat-view/SidebarChatProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,19 @@ export class SidebarChatProvider extends MessageProvider implements vscode.Webvi
// The web view is ready to receive events. We need to make sure that it has an up
// to date config, even if it was already published
await this.authProvider.announceNewAuthStatus()
// Hint local embeddings, if any, should start
void this.contextProvider.localEmbeddings?.start()
break
case 'initialized':
logDebug('SidebarChatProvider:onDidReceiveMessage', 'initialized')
await this.setWebviewView('chat')
await this.init()
break
case 'submit':
// Hint local embeddings, if any, should start so subsequent
// messages can use local embeddings. We delay to this point so
// local embeddings service start-up updating the context
// provider does not cause autocompletes to disappear.
void this.contextProvider.localEmbeddings?.start()

return this.onHumanMessageSubmitted(
message.text,
message.submitType,
Expand Down

0 comments on commit 3b18f6a

Please sign in to comment.