sessions: add multi-chat support to Copilot provider (#preview)#307258
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds preview-gated support for multiple chats within a single session in the Copilot sessions provider (sessions.github.copilot.multiChatSessions) by introducing a persisted grouping model and updating session lifecycle behaviors to treat a “session” as a group of chats.
Changes:
- Adds a persisted
SessionsGroupModelto group Copilot chats into multi-chat sessions and surfaces grouped sessions via aggregated observables (status, updatedAt, isRead, lastTurnEnd). - Extends the Copilot provider with “subsequent chat” creation/deletion flows while maintaining single-chat behavior when the setting is disabled.
- Adds unit tests for the Copilot sessions provider and updates sessions management to track the active chat during send-and-create flows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts | Updates active-chat handling during sendAndCreateChat to react to chat list changes while sending. |
| src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts | Implements multi-chat session grouping, subsequent chat creation, grouped deletion, and multi-chat change event handling behind a setting gate. |
| src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessions.contribution.ts | Registers the preview setting controlling multi-chat support for the Copilot provider. |
| src/vs/sessions/contrib/copilotChatSessions/test/browser/copilotChatSessionsProvider.test.ts | Adds unit tests covering provider identity, capabilities, session listing, and deletion behaviors in single- and multi-chat modes. |
lszomoru
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: