Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Support empty and multi-root workspaces - #3139

Merged
TylerLeonhardt merged 2 commits into
mainfrom
tyler/vulnerable-walrus
Jan 23, 2026
Merged

TylerLeonhardt merged 2 commits into
mainfrom
tyler/vulnerable-walrus

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Jan 23, 2026 •

Copy link
Copy Markdown
Member

The issue was the content provider loading from the wrong path. This is easy for the empty workspace case - even the terminal uses process.cwd.

But for multi-root it's more of a "best we can do" case because ideally we'd load chats from a different place than thecwd-influenced .. and instead be tied to the code-workspace file... but this was a decent compromise for now.

Fixes microsoft/vscode#290242

The issue was the content provider loading from the wrong path. This is easy for the empty workspace case - even the terminal uses process.cwd.

But for multi-root it's more of a "best we can do" case because ideally we'd load chats from a different place than  the`cwd`-influenced .. and instead be tied to the code-workspace file... but this was a decent compromise for now.
Copilot AI review requested due to automatic review settings January 23, 2026 22:28
@TylerLeonhardt TylerLeonhardt self-assigned this Jan 23, 2026
@vs-code-engineering vs-code-engineering Bot added this to the January 2026 milestone Jan 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates Claude Code session storage/loading behavior to work more reliably when there is no workspace folder open (empty workspace) and when there are multiple workspace roots, avoiding loading from an incorrect path.

Changes:

  • Adjusted session discovery to use a '-' “no-project” directory for empty and multi-root workspaces.
  • Updated Claude Code SDK session startup to set cwd only for single-root workspaces and pass workspace roots via additionalDirectories.
  • Added unit tests covering session loading for no-workspace and multi-root workspaces.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/extension/agents/claude/node/test/claudeCodeSessionService.spec.ts Adds coverage for empty-workspace and multi-root session loading behavior.
src/extension/agents/claude/node/claudeCodeSessionService.ts Changes project directory selection logic for session loading (single-root vs empty/multi-root).
src/extension/agents/claude/node/claudeCodeAgent.ts Changes SDK Options construction for cwd and additionalDirectories to better support empty/multi-root workspaces.

@TylerLeonhardt
TylerLeonhardt added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit 5c36205 Jan 23, 2026
@TylerLeonhardt
TylerLeonhardt deleted the tyler/vulnerable-walrus branch January 23, 2026 23:37
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.

Claude sessions: filter by workspace

3 participants