diff --git a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.ts b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.ts index e5056c7c279..28bb5d61c0a 100644 --- a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.ts +++ b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.ts @@ -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 } diff --git a/src/vs/workbench/contrib/chat/browser/chatSessions/common.ts b/src/vs/workbench/contrib/chat/browser/chatSessions/common.ts index 1b50c9750dd..ebff04aa1ed 100644 --- a/src/vs/workbench/contrib/chat/browser/chatSessions/common.ts +++ b/src/vs/workbench/contrib/chat/browser/chatSessions/common.ts @@ -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]); } diff --git a/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.ts b/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.ts index acac3a52c92..c5fcbf58b19 100644 --- a/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.ts +++ b/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.ts @@ -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; } diff --git a/src/vs/workbench/contrib/chat/test/browser/agentSessionViewModel.test.ts b/src/vs/workbench/contrib/chat/test/browser/agentSessionViewModel.test.ts index bb87a3b6540..1675de8fac8 100644 --- a/src/vs/workbench/contrib/chat/test/browser/agentSessionViewModel.test.ts +++ b/src/vs/workbench/contrib/chat/test/browser/agentSessionViewModel.test.ts @@ -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'),