sessions: extract local chat sessions into standalone provider#317979
Merged
sandy081 merged 1 commit intoMay 22, 2026
Merged
Conversation
lszomoru
previously approved these changes
May 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extracts “local” in-process VS Code chat sessions out of CopilotChatSessionsProvider into a dedicated LocalChatSessionsProvider (under src/vs/sessions/contrib/providers/localChatSessions/) and wires it into the Sessions/Agents window. It also updates session-type picker presentation and adjusts Copilot session actions to apply to the new local provider.
Changes:
- Introduces
LocalChatSessionsProvider(id: local-chat) with storage-backed session listing, one-time migration from chat history, and live status syncing. - Removes local-session support from
CopilotChatSessionsProviderand retargets shared picker/actionswhenclauses to include the new local provider. - Improves the session type picker UI by omitting provider group headers when session type labels are unique across providers; adds docs + unit tests.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/SESSIONS.md | Documents the new local chat sessions provider and links its spec doc. |
| src/vs/sessions/sessions.common.main.ts | Loads the new local provider contribution in the sessions app entrypoint. |
| src/vs/sessions/contrib/providers/localChatSessions/browser/localChatSessionsProvider.ts | New provider implementation: session lifecycle, storage persistence, migration, and model tracking. |
| src/vs/sessions/contrib/providers/localChatSessions/browser/localChatSessions.contribution.ts | Registers config + provider contribution and local-specific fork handling. |
| src/vs/sessions/contrib/providers/localChatSessions/LOCAL_CHAT_SESSIONS_PROVIDER.md | Adds provider architecture/spec documentation. |
| src/vs/sessions/contrib/providers/localChatSessions/test/browser/localChatSessionsProvider.test.ts | Adds unit tests for session types, persistence, lifecycle, archive/rename/delete, and status tracking. |
| src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts | Removes embedded local-session implementation and related imports/branches. |
| src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.ts | Retargets “local” session type references to the new provider and updates when clauses. |
| src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.ts | Removes local setting registration and local fork override (moved to local provider). |
| src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts | Hides provider group headers/separators when session type labels are unique across providers. |
Copilot's findings
- Files reviewed: 10/10 changed files
- Comments generated: 5
ef182d8 to
9cf23b1
Compare
Move the local harness (in-process VS Code chat sessions) from CopilotChatSessionsProvider into its own LocalChatSessionsProvider under contrib/providers/localChatSessions/. The new provider uses IChatService directly instead of the agent sessions model: - startNewLocalSession() for creating chat models - sendRequest() for sending messages - IGitService for git state resolution Changes: - New LocalChatSessionsProvider implementing ISessionsProvider - New localChatSessions.contribution.ts with setting registration and ForkConversationAction override - Removed LocalNewSession class from copilotChatSessionsProvider - Removed LOCAL_SESSION_ENABLED_SETTING from copilot provider - Updated copilotChatSessionsActions to import LocalSessionType from new provider - Updated sessions.common.main.ts entry point Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9cf23b1 to
1ec79da
Compare
lramos15
approved these changes
May 22, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Extract the local harness (in-process VS Code chat sessions) from
CopilotChatSessionsProviderinto a standaloneLocalChatSessionsProviderundersrc/vs/sessions/contrib/providers/localChatSessions/.What changed
LocalChatSessionsProvider(id: 'local-chat') that usesIChatServicedirectly — noIAgentSessionsServicedependency. Creates models viastartNewLocalSession(), sends viasendRequest(), resolves git state viaIGitService.LocalSessionclass with two construction paths controlled by adetail: IChatDetail | undefinedparameter (new vs restored from history).IStorageService(profile-scoped, machine target) under keysessions.localChat.sessions. Each entry storesuri,title,createdAt,lastMessageDate,workingDirectory, and optionalarchivedflag — no runtime dependency on chat history APIs for listing.getLocalSessionHistory()brings forward existing local chat sessions on first run (guarded bysessions.localChat.migratedflag).LocalSession.trackModel(model, onChange)— subscribes tomodel.requestInProgressto flip status betweenInProgressandCompleted.whenclauses to match local sessions from the new provider, not just the copilot one.CopilotChatSessionsProvider(theLocalNewSessionclass,LocalSessionType,LOCAL_SESSION_ENABLED_SETTING, and associated branches increateNewSession,createNewChat,_sendFirstChat,_refreshSessionCache, etc).LOCAL_CHAT_SESSIONS_PROVIDER.mdand updatedSESSIONS.mdproviders list.Notes for reviewers
CopilotChatSessionsProviderandAgentHostproviders.