Skip to content

Improve workspace picker preselection - #328995

Merged
Benjamin Christopher Simmonds (benibenj) merged 1 commit into
mainfrom
benibenj/agents/workspace-picker-preselection-rules
Aug 4, 2026
Merged

Benjamin Christopher Simmonds (benibenj) merged 1 commit into
mainfrom
benibenj/agents/workspace-picker-preselection-rules

Conversation

@benibenj

Copy link
Copy Markdown
Contributor

Summary

  • fall back to the most recent VS Code workspace when Agents history is empty
  • preserve manually selected worktree folders in Agents history while excluding them from automatic preselection
  • filter .worktrees and copilot-worktrees entries from general VS Code recents

Testing

  • targeted workspace picker tests (39 passing)
  • hygiene check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Sandeep Somavarapu (@sandy081)

Matched files:

  • src/vs/sessions/services/sessions/browser/sessionsRecentWorkspacesService.ts

Ladislau Szomoru (@lszomoru)

Matched files:

  • src/vs/sessions/services/sessions/browser/sessionsRecentWorkspacesService.ts

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.

🟡 Not ready to approve

Web restoration can select a recent workspace belonging to a provider other than the currently scoped host.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Improves Agents workspace restoration while preventing generated worktrees from being automatically selected.

Changes:

  • Falls back to VS Code’s recent workspaces.
  • Preserves manual worktree history while excluding it from preselection.
  • Adds targeted restoration and filtering tests.
File summaries
File Description
src/vs/sessions/SESSIONS.md Documents workspace restoration rules.
src/vs/sessions/services/sessions/browser/sessionsRecentWorkspacesService.ts Filters generated worktree paths.
src/vs/sessions/contrib/chat/test/browser/sessionWorkspacePicker.test.ts Tests fallback, filtering, and asynchronous restoration.
src/vs/sessions/contrib/chat/browser/webWorkspacePicker.ts Excludes worktrees during host-scoped restoration.
src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts Implements merged-history restoration and preselection filtering.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment on lines +1009 to +1011
for (const recent of this.recentWorkspacesService.getRecentWorkspaces()) {
const folderUri = recent.workspace.folders[0]?.root;
if (!folderUri || isWorktreeWorkspaceUri(folderUri) || this._isProviderUnavailable(recent.providerId)) {
@benibenj
Benjamin Christopher Simmonds (benibenj) merged commit 70b3c04 into main Aug 4, 2026
46 of 48 checks passed
@benibenj
Benjamin Christopher Simmonds (benibenj) deleted the benibenj/agents/workspace-picker-preselection-rules branch August 4, 2026 18:29
@vs-code-engineering vs-code-engineering Bot added this to the 1.133.0 milestone Aug 4, 2026
Don Jayamanne (DonJayamanne) added a commit that referenced this pull request Aug 4, 2026
* origin/main: (31 commits)
  Improve workspace picker preselection (#328995)
  agentHost: support Codex custom agents and runtime enablement (#328956)
  Finalizes customEditorPriority proposal. Closes #292379 (#329002)
  Add Agents window startup A/A experiment trigger (#328454)
  sessions: show created session pill in response summary (#328984)
  Fix onboarding microphone picker visibility (#329011)
  Explains how to develop the markdown editor (#329009)
  Conditional agent-window auth for signed-out users (#328990)
  Fix BYOK enterprise policy handling in agent host
  Agent Host changes for fix/agent-host-byok-enterprise-policy
  agentHost: drive tool execution from the session input queue (#328989)
  Make Integrated Browser smoke tests deterministic across build qualities (#328983)
  Accept box sizing screenshot changes
  Avoid large Component Fixtures step outputs
  Remove component fixture box sizing reset
  fix: guard stale line numbers in test decorations (fixes #328988)
  sessions: fix maximized side pane toggle (#328974)
  Add component fixture rendering controls
  Reduce floating panel margins for layout consistency (#328963)
  agentHost: support file completions across workspace roots (#328944)
  ...

# Conflicts:
#	src/vs/sessions/SESSIONS.md
#	src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Sep 18, 2026
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.

3 participants