fix session types when switching workspaces#312227
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses incorrect/invalid session-type behavior when switching workspaces in the Agents/Sessions chat UI by ensuring session type options are derived from the newly selected workspace and by correctly identifying Copilot Cloud sessions when getSessionTypes is invoked with a session-resource URI.
Changes:
- Update Copilot provider
getSessionTypesto treat Copilot Cloud session-resource URI schemes as Cloud-only. - When switching workspaces in the New Chat view, validate the currently selected session type against the new workspace’s supported session types before creating the new session.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts | Fixes Cloud session-type detection when getSessionTypes is called with a Copilot Cloud session URI scheme. |
| src/vs/sessions/contrib/chat/browser/newChatViewPane.ts | Validates/picks a supported session type on workspace switch before calling _onWorkspaceSelected. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts:1291
getSessionTypesnow has special handling forworkspaceUri.scheme === SessionType.CopilotCloud(i.e. when called with a session resource URI), but the existing unit tests only coverfileandgithub-remote-fileschemes. Add a test case that passes a URI with the Copilot Cloud session scheme (e.g.URI.from({ scheme: AgentSessionProviders.Cloud, ... })) and asserts onlyCopilotCloudSessionTypeis returned.
if (workspaceUri.scheme === GITHUB_REMOTE_FILE_SCHEME || workspaceUri.scheme === SessionType.CopilotCloud) {
return [CopilotCloudSessionType];
}
- Files reviewed: 2/2 changed files
- Comments generated: 2
TylerLeonhardt
approved these changes
Apr 23, 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.
No description provided.