Skip to content

sessions: add multi-chat support to Copilot provider (#preview)#307258

Merged
sandy081 merged 2 commits into
mainfrom
sandy081/probable-porcupine
Apr 1, 2026
Merged

sessions: add multi-chat support to Copilot provider (#preview)#307258
sandy081 merged 2 commits into
mainfrom
sandy081/probable-porcupine

Conversation

@sandy081
Copy link
Copy Markdown
Member

@sandy081 sandy081 commented Apr 1, 2026

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

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
Copilot AI review requested due to automatic review settings April 1, 2026 21:15
@sandy081 sandy081 enabled auto-merge (squash) April 1, 2026 21:15
@sandy081 sandy081 self-assigned this Apr 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SessionsGroupModel to 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.

Comment thread src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts Outdated
@sandy081 sandy081 added this to the 1.115.0 milestone Apr 1, 2026
@sandy081 sandy081 merged commit c3ae78e into main Apr 1, 2026
19 checks passed
@sandy081 sandy081 deleted the sandy081/probable-porcupine branch April 1, 2026 21:59
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators May 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants