agent sessions - support history entries and dedupe (#277110)

This commit is contained in:
Benjamin Pasero
2025-11-13 13:04:55 +01:00
committed by GitHub
parent 4aceaa814d
commit 94c8fb6ec3
4 changed files with 3 additions and 13 deletions

View File

@@ -152,7 +152,7 @@ export class AgentSessionsViewModel extends Disposable implements IAgentSessions
}
for (const session of sessions) {
if (session.id === 'show-history' || session.id === 'workbench.panel.chat.view.copilot') {
if (session.id === 'workbench.panel.chat.view.copilot') {
continue; // TODO@bpasero this needs to be fixed at the provider level
}

View File

@@ -136,11 +136,6 @@ export function getSessionItemContextOverlay(
editorGroupsService?: IEditorGroupsService
): [string, any][] {
const overlay: [string, any][] = [];
// Do not create an overaly for the show-history node
if (session.id === 'show-history') {
return overlay;
}
if (provider) {
overlay.push([ChatContextKeys.sessionType.key, provider.chatSessionType]);
}

View File

@@ -242,7 +242,8 @@ export class LocalChatSessionsProvider extends Disposable implements IChatSessio
}
});
const history = await this.getHistoryItems();
sessions.push(...history);
const existingIds = new Set(sessions.map(s => s.id));
sessions.push(...history.filter(h => !existingIds.has(h.id)));
return sessions;
}

View File

@@ -273,12 +273,6 @@ suite('AgentSessionsViewModel', () => {
chatSessionType: 'test-type',
onDidChangeChatSessionItems: Event.None,
provideChatSessionItems: async () => [
{
id: 'show-history',
resource: URI.parse('test://show-history'),
label: 'Show History',
timing: { startTime: Date.now() }
},
{
id: 'workbench.panel.chat.view.copilot',
resource: URI.parse('test://copilot'),