diff --git a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.ts b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.ts index 209ea059bcc..f83e4d138ac 100644 --- a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.ts +++ b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.ts @@ -11,7 +11,7 @@ import { registerAction2, Action2, MenuId } from '../../../../../platform/action import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js'; import { IStorageService, StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js'; import { IChatSessionsService } from '../../common/chatSessionsService.js'; -import { AgentSessionProviders, getAgentSessionProviderName } from './agentSessions.js'; +import { AgentSessionProviders, getAgentSessionProvider, getAgentSessionProviderName } from './agentSessions.js'; import { AgentSessionStatus, IAgentSession } from './agentSessionsModel.js'; import { IAgentSessionsFilter, IAgentSessionsFilterExcludes } from './agentSessionsViewer.js'; @@ -127,17 +127,21 @@ export class AgentSessionsFilter extends Disposable implements Required ({ - id: provider, - label: getAgentSessionProviderName(provider) - })); + const providers: { id: string; label: string }[] = [{ + id: AgentSessionProviders.Local, + label: getAgentSessionProviderName(AgentSessionProviders.Local) + }]; - for (const provider of this.chatSessionsService.getAllChatSessionContributions()) { - if (providers.find(p => p.id === provider.type)) { + for (const contribution of this.chatSessionsService.getAllChatSessionContributions()) { + if (providers.find(p => p.id === contribution.type)) { continue; // already added } - providers.push({ id: provider.type, label: provider.name }); + const knownProvider = getAgentSessionProvider(contribution.type); + providers.push({ + id: contribution.type, + label: knownProvider ? getAgentSessionProviderName(knownProvider) : contribution.displayName + }); } const that = this; 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 344bc51d962..8a6372af31d 100644 --- a/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts +++ b/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts @@ -333,7 +333,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ const builtinSessionProviders = [AgentSessionProviders.Local]; const contributedSessionProviders = observableFromEvent( this.onDidChangeAvailability, - () => Array.from(this._contributions.keys()).filter(isAgentSessionProviderType) as AgentSessionProviders[], + () => Array.from(this._contributions.keys()).filter(key => this._contributionDisposables.has(key) && isAgentSessionProviderType(key)) as AgentSessionProviders[], ).recomputeInitiallyAndOnChange(this._store); this._register(autorun(reader => { @@ -371,8 +371,6 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ displayName = localize('chat.session.inProgress.background', "Background Agent"); } else if (chatSessionType === AgentSessionProviders.Cloud) { displayName = localize('chat.session.inProgress.cloud', "Cloud Agent"); - } else if (chatSessionType === AgentSessionProviders.Growth) { - displayName = localize('chat.session.inProgress.growth', "Growth"); } else { displayName = this._contributions.get(chatSessionType)?.contribution.displayName; }