diff --git a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.ts b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.ts index c9e3d0c4a96..8952b2339b1 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.ts @@ -9,7 +9,9 @@ import { Emitter, Event } from '../../../../../../base/common/event.js'; import { Disposable, DisposableStore } from '../../../../../../base/common/lifecycle.js'; import { ThemeIcon } from '../../../../../../base/common/themables.js'; import { localize } from '../../../../../../nls.js'; +import { IContextKeyService } from '../../../../../../platform/contextkey/common/contextkey.js'; import { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js'; +import { ChatContextKeys } from '../../../common/actions/chatContextKeys.js'; import { IChatMode } from '../../../common/chatModes.js'; import { IChatSessionsService } from '../../../common/chatSessionsService.js'; import { IHandOff } from '../../../common/promptSyntax/promptFileParser.js'; @@ -36,7 +38,8 @@ export class ChatSuggestNextWidget extends Disposable { constructor( @IContextMenuService private readonly contextMenuService: IContextMenuService, - @IChatSessionsService private readonly chatSessionsService: IChatSessionsService + @IChatSessionsService private readonly chatSessionsService: IChatSessionsService, + @IContextKeyService private readonly contextKeyService: IContextKeyService ) { super(); this.domNode = this.createSuggestNextWidget(); @@ -126,11 +129,15 @@ export class ChatSuggestNextWidget extends Disposable { // Get chat session contributions to show in chevron dropdown // Filter to only first-party providers that support "continue in". // TODO: Expand later to any agent with `canDelegate` === true. + const currentSessionType = this.contextKeyService.getContextKeyValue(ChatContextKeys.chatSessionType.key); const contributions = this.chatSessionsService.getAllChatSessionContributions(); const availableContributions = contributions.filter(c => { if (!c.canDelegate) { return false; } + if (c.type === currentSessionType) { + return false; + } const provider = getAgentSessionProvider(c.type); return provider !== undefined && getAgentCanContinueIn(provider); });