From 834eb347eb1d33671b177128cdb74042d9fc809d Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:15:06 -0800 Subject: [PATCH 1/3] fix https://github.com/microsoft/vscode/issues/288172 --- .../widget/input/editor/chatInputCompletions.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts b/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts index 34ec28bad76c3..fcd37e35aeb79 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts @@ -53,6 +53,7 @@ import { IChatRequestVariableEntry } from '../../../../common/attachments/chatVa import { IDynamicVariable } from '../../../../common/attachments/chatVariables.js'; import { ChatAgentLocation, ChatModeKind, isSupportedChatFileScheme } from '../../../../common/constants.js'; import { isToolSet } from '../../../../common/tools/languageModelToolsService.js'; +import { IChatSessionsService } from '../../../../common/chatSessionsService.js'; import { IPromptsService } from '../../../../common/promptSyntax/service/promptsService.js'; import { ChatSubmitAction, IChatExecuteActionContext } from '../../../actions/chatExecuteActions.js'; import { IChatWidget, IChatWidgetService } from '../../../chat.js'; @@ -270,6 +271,7 @@ class AgentCompletions extends Disposable { @IChatWidgetService private readonly chatWidgetService: IChatWidgetService, @IChatAgentService private readonly chatAgentService: IChatAgentService, @IChatAgentNameService private readonly chatAgentNameService: IChatAgentNameService, + @IChatSessionsService private readonly chatSessionsService: IChatSessionsService, ) { super(); @@ -337,6 +339,9 @@ class AgentCompletions extends Disposable { const agents = this.chatAgentService.getAgents() .filter(a => a.locations.includes(widget.location)); + // Filter out chatSessions contributions for slash command completions + const agentsForSlashCommands = agents.filter(a => !this.chatSessionsService.getChatSessionContribution(a.id)); + // When the input is only `/`, items are sorted by sortText. // When typing, filterText is used to score and sort. // The same list is refiltered/ranked while typing. @@ -369,7 +374,7 @@ class AgentCompletions extends Disposable { return { suggestions: justAgents.concat( - coalesce(agents.flatMap(agent => agent.slashCommands.map((c, i) => { + coalesce(agentsForSlashCommands.flatMap(agent => agent.slashCommands.map((c, i) => { if (agent.isDefault && this.chatAgentService.getDefaultAgent(widget.location, widget.input.currentModeKind)?.id !== agent.id) { return; } @@ -429,7 +434,9 @@ class AgentCompletions extends Disposable { } const agents = this.chatAgentService.getAgents() - .filter(a => a.locations.includes(widget.location) && a.modes.includes(widget.input.currentModeKind)); + .filter(a => a.locations.includes(widget.location) && a.modes.includes(widget.input.currentModeKind)) + // Filter out chatSessions contributions for slash command completions + .filter(a => !this.chatSessionsService.getChatSessionContribution(a.id)); return { suggestions: coalesce(agents.flatMap(agent => agent.slashCommands.map((c, i) => { From 7fb9df4050aef3af6208863f21eba5a2c1a6e881 Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:28:31 -0800 Subject: [PATCH 2/3] Update src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../chat/browser/widget/input/editor/chatInputCompletions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts b/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts index fcd37e35aeb79..11e202a761275 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts @@ -340,7 +340,9 @@ class AgentCompletions extends Disposable { .filter(a => a.locations.includes(widget.location)); // Filter out chatSessions contributions for slash command completions - const agentsForSlashCommands = agents.filter(a => !this.chatSessionsService.getChatSessionContribution(a.id)); + const chatSessionContributions = this.chatSessionsService.getAllChatSessionContributions(); + const chatSessionAgentIds = new Set(chatSessionContributions.map(contribution => contribution.id)); + const agentsForSlashCommands = agents.filter(a => !chatSessionAgentIds.has(a.id)); // When the input is only `/`, items are sorted by sortText. // When typing, filterText is used to score and sort. From c8d39f4ac63a0742ee7b675cb1c176a525e9408f Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:31:42 -0800 Subject: [PATCH 3/3] fix --- .../chat/browser/widget/input/editor/chatInputCompletions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts b/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts index 11e202a761275..062f4d55cb614 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts @@ -341,7 +341,7 @@ class AgentCompletions extends Disposable { // Filter out chatSessions contributions for slash command completions const chatSessionContributions = this.chatSessionsService.getAllChatSessionContributions(); - const chatSessionAgentIds = new Set(chatSessionContributions.map(contribution => contribution.id)); + const chatSessionAgentIds = new Set(chatSessionContributions.map(contribution => contribution.type)); const agentsForSlashCommands = agents.filter(a => !chatSessionAgentIds.has(a.id)); // When the input is only `/`, items are sorted by sortText.