mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-24 16:35:55 +01:00
Don't throw in setRequestTools when agent is gone (#313068)
Fixes #312803 The autorun in chatServiceImpl that calls setRequestTools is per-request and can fire after the target agent has been unregistered (e.g., setup.vscode is disposed when Copilot setup completes while a request is still in-flight). Throwing here surfaces as an unhandled error from inside the autorun. Match the existing pattern used by setYieldRequested and getFollowups in the same file and silently return. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -537,7 +537,7 @@ export class ChatAgentService extends Disposable implements IChatAgentService {
|
||||
setRequestTools(id: string, requestId: string, tools: UserSelectedTools): void {
|
||||
const data = this._agents.get(id);
|
||||
if (!data?.impl) {
|
||||
throw new Error(`No activated agent with id "${id}"`);
|
||||
return;
|
||||
}
|
||||
|
||||
data.impl.setRequestTools?.(requestId, tools);
|
||||
|
||||
Reference in New Issue
Block a user