mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
don't block chat when collecting instructions fail (#306161)
This commit is contained in:
committed by
GitHub
parent
ba1bdcd30b
commit
d7ebb2cc7d
@@ -2819,13 +2819,16 @@ export class ChatWidget extends Disposable implements IChatWidget {
|
||||
this.logService.debug(`ChatWidget#_autoAttachInstructions: skipped, autoAttachReferences is disabled`);
|
||||
return;
|
||||
}
|
||||
|
||||
this.logService.debug(`ChatWidget#_autoAttachInstructions: prompt files are enabled`);
|
||||
const enabledTools = this.input.currentModeKind === ChatModeKind.Agent ? this.input.selectedToolsModel.userSelectedTools.get() : undefined;
|
||||
const enabledSubAgents = this.input.currentModeKind === ChatModeKind.Agent ? this.input.currentModeObs.get().agents?.get() : undefined;
|
||||
const sessionResource = this._viewModel?.model.sessionResource;
|
||||
const computer = this.instantiationService.createInstance(ComputeAutomaticInstructions, this.input.currentModeKind, enabledTools, enabledSubAgents, sessionResource);
|
||||
await computer.collect(attachedContext, CancellationToken.None);
|
||||
try {
|
||||
this.logService.debug(`ChatWidget#_autoAttachInstructions: prompt files are enabled`);
|
||||
const enabledTools = this.input.currentModeKind === ChatModeKind.Agent ? this.input.selectedToolsModel.userSelectedTools.get() : undefined;
|
||||
const enabledSubAgents = this.input.currentModeKind === ChatModeKind.Agent ? this.input.currentModeObs.get().agents?.get() : undefined;
|
||||
const sessionResource = this._viewModel?.model.sessionResource;
|
||||
const computer = this.instantiationService.createInstance(ComputeAutomaticInstructions, this.input.currentModeKind, enabledTools, enabledSubAgents, sessionResource);
|
||||
await computer.collect(attachedContext, CancellationToken.None);
|
||||
} catch (err) {
|
||||
this.logService.error(`ChatWidget#_autoAttachInstructions: failed to compute automatic instructions`, err);
|
||||
}
|
||||
}
|
||||
|
||||
delegateScrollFromMouseWheelEvent(browserEvent: IMouseWheelEvent): void {
|
||||
|
||||
Reference in New Issue
Block a user