Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -127,17 +127,21 @@ export class AgentSessionsFilter extends Disposable implements Required<IAgentSe
}

private registerProviderActions(disposables: DisposableStore, menuId: MenuId): void {
const providers: { id: string; label: string }[] = Object.values(AgentSessionProviders).map(provider => ({
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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;
}
Expand Down
Loading