Skip to content

Commit cb9d1e4

Browse files
authored
Don't throw for $updateAgent failure (microsoft#218649)
Fix microsoft#214157 This can happen after something else went wrong, and the exception doesn't go back to the extension or anywhere helpful besides error telemetry.
1 parent 5950c29 commit cb9d1e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vs/workbench/api/browser/mainThreadChatAgents2.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA
199199
$updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): void {
200200
const data = this._agents.get(handle);
201201
if (!data) {
202-
throw new Error(`No agent with handle ${handle} registered`);
202+
this._logService.error(`MainThreadChatAgents2#$updateAgent: No agent with handle ${handle} registered`);
203+
return;
203204
}
204205
data.hasFollowups = metadataUpdate.hasFollowups;
205206
this._chatAgentService.updateAgent(data.id, revive(metadataUpdate));

0 commit comments

Comments
 (0)