Skip to content

Commit

Permalink
Enable async registration of chat participants (#233444)
Browse files Browse the repository at this point in the history
* Enable async registration of chat participants

* Fix build

* Revert "Fix build"

This reverts commit c4b489b.

* Revert "Enable async registration of chat participants"

This reverts commit 918fd7c.

* Try it this way

* Wait before checking registration
  • Loading branch information
roblourens authored Nov 11, 2024
1 parent 9b365ca commit c00f3f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vs/workbench/api/browser/mainThreadChatAgents2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA
this._chatService.transferChatSession({ sessionId, inputValue }, URI.revive(toWorkspace));
}

$registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: IDynamicChatAgentProps | undefined): void {
async $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: IDynamicChatAgentProps | undefined): Promise<void> {
await this._extensionService.whenInstalledExtensionsRegistered();
const staticAgentRegistration = this._chatAgentService.getAgent(id, true);
if (!staticAgentRegistration && !dynamicProps) {
if (this._chatAgentService.getAgentsByName(id).length) {
Expand Down Expand Up @@ -209,7 +210,8 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA
});
}

$updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): void {
async $updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): Promise<void> {
await this._extensionService.whenInstalledExtensionsRegistered();
const data = this._agents.get(handle);
if (!data) {
this._logService.error(`MainThreadChatAgents2#$updateAgent: No agent with handle ${handle} registered`);
Expand Down

0 comments on commit c00f3f5

Please sign in to comment.