Skip to content

Commit 78f83fc

Browse files
committed
sessions: add multi-chat support to Copilot provider (#preview)
Add support for multiple chats within a single session in the Copilot Chat sessions provider, gated behind the preview setting `sessions.github.copilot.multiChatSessions`. Key changes: - Integrate SessionsGroupModel into CopilotChatSessionsProvider for chat-to-session grouping with storage persistence - Add _sendSubsequentChat() for creating new chats in existing sessions with workspace isolation mode - _chatToSession() builds multi-chat observable from group model with aggregated status, updatedAt, isRead, lastTurnEnd across all chats - Session title and properties always come from the primary (first) chat - getSessions() deduplicates by group ID when multi-chat is enabled - deleteSession() removes all chats in the group - deleteChat() removes individual chats; delegates to deleteSession when only one chat remains - _refreshSessionCacheMultiChat() handles removed chats that belong to groups with siblings as changed events on the parent session - Management service tracks active chat via autorun on chats observable - All multi-chat code paths fall back to single-chat behavior when the setting is disabled - Comprehensive unit tests for the provider
1 parent 98f6cbe commit 78f83fc

4 files changed

Lines changed: 986 additions & 45 deletions

File tree

src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessions.contribution.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,24 @@
66
import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../../workbench/common/contributions.js';
77
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
88
import { Disposable } from '../../../../base/common/lifecycle.js';
9-
import { CopilotChatSessionsProvider } from '../../copilotChatSessions/browser/copilotChatSessionsProvider.js';
9+
import { CopilotChatSessionsProvider, COPILOT_MULTI_CHAT_SETTING } from '../../copilotChatSessions/browser/copilotChatSessionsProvider.js';
1010
import '../../copilotChatSessions/browser/copilotChatSessionsActions.js';
1111
import { ISessionsProvidersService } from '../../sessions/browser/sessionsProvidersService.js';
12+
import { Registry } from '../../../../platform/registry/common/platform.js';
13+
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from '../../../../platform/configuration/common/configurationRegistry.js';
14+
import { localize } from '../../../../nls.js';
15+
16+
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
17+
id: 'sessions',
18+
properties: {
19+
[COPILOT_MULTI_CHAT_SETTING]: {
20+
type: 'boolean',
21+
default: false,
22+
tags: ['preview'],
23+
description: localize('sessions.github.copilot.multiChatSessions', "Whether to enable multiple chats within a single session in the Copilot Chat sessions provider."),
24+
},
25+
},
26+
});
1227

1328
/**
1429
* Registers the {@link CopilotChatSessionsProvider} as a sessions provider.

0 commit comments

Comments
 (0)