Fix "Open in VS Code" not opening workspace for Claude agent sessions#312468
Merged
TylerLeonhardt merged 3 commits intomainfrom Apr 25, 2026
Merged
Fix "Open in VS Code" not opening workspace for Claude agent sessions#312468TylerLeonhardt merged 3 commits intomainfrom
TylerLeonhardt merged 3 commits intomainfrom
Conversation
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/782a3628-d9b0-4ea2-ae50-9b6869f9a707 Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix 'Open in VS Code' action for Claude sessions
Fix "Open in VS Code" not opening workspace for Claude agent sessions
Apr 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the Agents window “Open in VS Code” action so that Claude Code sessions (in addition to Copilot CLI sessions) correctly open the associated workspace folder when launching VS Code.
Changes:
- Switch folder-URI extraction guard from
CopilotCLISessionType.idtoisWorkspaceAgentSessionType(...)in both web and desktop implementations. - Add a focused unit test suite covering
isWorkspaceAgentSessionTypefor Copilot CLI, Claude Code, cloud, unknown, andundefinedinputs.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/chat/browser/openInVSCode.contribution.ts | Uses isWorkspaceAgentSessionType to include Claude Code sessions when resolving the folder URI for “Open in VS Code”. |
| src/vs/sessions/contrib/chat/electron-browser/openInVSCode.contribution.ts | Same session-type gating change for the desktop “Open in VS Code” action path (sibling app / protocol handler). |
| src/vs/sessions/services/sessions/test/common/session.test.ts | Adds unit tests validating isWorkspaceAgentSessionType behavior across relevant session types. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 0
bhavyaus
approved these changes
Apr 25, 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.
Clicking "Open in VS Code" from a Claude session opened the session but silently skipped opening the workspace folder. Copilot CLI sessions worked correctly because the folder URI extraction was explicitly gated on
CopilotCLISessionType.id.Changes
browser/openInVSCode.contribution.ts/electron-browser/openInVSCode.contribution.ts: Replace the session-type guard with the existingisWorkspaceAgentSessionType()helper, which already covers both'copilotcli'and'claude-code'.For Claude sessions,
repo.uriis alreadyURI.file(workingDirectoryPath), soworkingDirectory ?? uricorrectly resolves to the working directory for both session types.