Skip to content

fix session types when switching workspaces#312227

Merged
sandy081 merged 1 commit intomainfrom
sandy081/strict-ptarmigan
Apr 23, 2026
Merged

fix session types when switching workspaces#312227
sandy081 merged 1 commit intomainfrom
sandy081/strict-ptarmigan

Conversation

@sandy081
Copy link
Copy Markdown
Member

No description provided.

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 23, 2026 21:20
@sandy081 sandy081 enabled auto-merge (squash) April 23, 2026 21:20
@sandy081 sandy081 self-assigned this Apr 23, 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 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 getSessionTypes to 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

  • getSessionTypes now has special handling for workspaceUri.scheme === SessionType.CopilotCloud (i.e. when called with a session resource URI), but the existing unit tests only cover file and github-remote-file schemes. Add a test case that passes a URI with the Copilot Cloud session scheme (e.g. URI.from({ scheme: AgentSessionProviders.Cloud, ... })) and asserts only CopilotCloudSessionType is returned.
		if (workspaceUri.scheme === GITHUB_REMOTE_FILE_SCHEME || workspaceUri.scheme === SessionType.CopilotCloud) {
			return [CopilotCloudSessionType];
		}
  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/contrib/chat/browser/newChatViewPane.ts
@sandy081 sandy081 merged commit 9c2b70d into main Apr 23, 2026
44 of 45 checks passed
@sandy081 sandy081 deleted the sandy081/strict-ptarmigan branch April 23, 2026 22:43
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants