diff --git a/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts b/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts index f7682e6a754..d5374489048 100644 --- a/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts +++ b/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts @@ -216,6 +216,11 @@ const extensionPoint = ExtensionsRegistry.registerExtensionPoint { + const contribution = this._lockedAgent ? this.chatSessionsService.getChatSessionContribution(this._lockedAgent.id) : undefined; + if (!contribution?.autoAttachReferences) { + this.logService.debug(`ChatWidget#_autoAttachInstructions: skipped, autoAttachReferences is disabled`); + return; + } this.logService.debug(`ChatWidget#_autoAttachInstructions: prompt files are always 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; diff --git a/src/vs/workbench/contrib/chat/common/chatSessionsService.ts b/src/vs/workbench/contrib/chat/common/chatSessionsService.ts index 9ce4da92769..411fd522ced 100644 --- a/src/vs/workbench/contrib/chat/common/chatSessionsService.ts +++ b/src/vs/workbench/contrib/chat/common/chatSessionsService.ts @@ -94,6 +94,11 @@ export interface IChatSessionsExtensionPoint { */ readonly customAgentTarget?: Target; readonly requiresCustomModels?: boolean; + /** + * Decides whether to automatically attach instruction files to chat requests + * for this session type. Defaults to false when not specified. + */ + readonly autoAttachReferences?: boolean; } export interface IChatSessionItem {