mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
agent sessions - support history entries and dedupe (#277110)
This commit is contained in:
@@ -152,7 +152,7 @@ export class AgentSessionsViewModel extends Disposable implements IAgentSessions
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const session of sessions) {
|
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
|
continue; // TODO@bpasero this needs to be fixed at the provider level
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,11 +136,6 @@ export function getSessionItemContextOverlay(
|
|||||||
editorGroupsService?: IEditorGroupsService
|
editorGroupsService?: IEditorGroupsService
|
||||||
): [string, any][] {
|
): [string, any][] {
|
||||||
const overlay: [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) {
|
if (provider) {
|
||||||
overlay.push([ChatContextKeys.sessionType.key, provider.chatSessionType]);
|
overlay.push([ChatContextKeys.sessionType.key, provider.chatSessionType]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,7 +242,8 @@ export class LocalChatSessionsProvider extends Disposable implements IChatSessio
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const history = await this.getHistoryItems();
|
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;
|
return sessions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -273,12 +273,6 @@ suite('AgentSessionsViewModel', () => {
|
|||||||
chatSessionType: 'test-type',
|
chatSessionType: 'test-type',
|
||||||
onDidChangeChatSessionItems: Event.None,
|
onDidChangeChatSessionItems: Event.None,
|
||||||
provideChatSessionItems: async () => [
|
provideChatSessionItems: async () => [
|
||||||
{
|
|
||||||
id: 'show-history',
|
|
||||||
resource: URI.parse('test://show-history'),
|
|
||||||
label: 'Show History',
|
|
||||||
timing: { startTime: Date.now() }
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'workbench.panel.chat.view.copilot',
|
id: 'workbench.panel.chat.view.copilot',
|
||||||
resource: URI.parse('test://copilot'),
|
resource: URI.parse('test://copilot'),
|
||||||
|
|||||||
Reference in New Issue
Block a user