Skip to content

sessions: workspaces filter bar in every grouping and list-side scoping - #350603

Draft
Sandeep Somavarapu (sandy081) wants to merge 8 commits into
mainfrom
sandy081/agents/infra-workspaces-filter
Draft

Sandeep Somavarapu (sandy081) wants to merge 8 commits into
mainfrom
sandy081/agents/infra-workspaces-filter

Conversation

@sandy081

@sandy081 Sandeep Somavarapu (sandy081) commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What

  • New experimental setting sessions.list.workspacesFilter.enabled (off by default). When on, the "All Workspaces | All Environments" bar shows in every Sessions list grouping, not only Inbox, in the Agents window and in empty editor windows. Folder and multi-root editor windows show no extra bar and keep their own scope. Picking a workspace narrows the list and sets the window's workbench scope; All Workspaces scopes the window to all workspaces. Each window remembers its own pick.
  • In editor windows with the new Sessions list (chat.viewSessions.sessionsList.enabled) and sessions.list.workspacesFilter.enabled both on, workspace scoping moves from the session providers into the list: providers list every session and the list narrows to the window's folders (including worktrees), as the Agents window does. The old Chat view list keeps provider filtering.

Changes

  • sessionsWorkbenchScope.ts: single owner of the bar's window scope, through a new editable workspace-context contract implemented by the editor WorkspaceService and AgentsWorkspaceContextService. It scopes the window only while the bar is shown (setting on, no folders in the window, AI features enabled and not hidden).
  • sessionScope.ts: shared getSessionsInScope matcher used by the list, the picker counts and pending (draft/scheduled) rows.
  • sessionsList.ts, sessionsView.ts, sessionsInboxScope.ts, sessionsListFilters.ts: the bar in all groupings, list-side scope, picker options from the sessions the list includes (before the bar's own pick), the workspace/environment pick stored per window (workspace storage), case-insensitive workspace identity with deduplication within the same environment.
  • workspaceFolderRepositories.ts: one per-window reading of the window's folders and repositories (IWorkspaceFolderRepositories), shared by the providers and the Sessions lists.
  • editorWindowSessionsProvidersService.ts, agentHostSessionList*: providers and the agent host list the full inventory only while the new list and the workspaces filter setting are both on (IChatViewSessionsListService.listsAllSessions); the setting key lives in ChatConfiguration.
  • Setting registration in sessionConfig.ts, sessionsConfiguration.ts and the Agents sessions.contribution.ts; SESSIONS_LIST.md updated.

Notes for reviewers

  • Extensions that narrow on their own stay narrowed: Copilot Cloud discovery is limited to the workspace's GitHub repositories, so the list can't widen it. The Copilot CLI already returns all sessions.
  • The Inbox workspace/environment pick now lives in workspace storage, so it's per window even with the setting off, and lists in one window share it live. The profile-wide pick of earlier builds is removed, not migrated, so each window starts once on All Workspaces. Code that seeds the pick (for example Agentic Mode's pre-select) must write it at workspace scope.
  • IEditableWorkspaceContextService requires setWorkbenchScope/resetWorkbenchScope; any other branch adding the same decorator needs to adopt this shape.
  • Otherwise nothing changes while the new list and the setting are off.

Validation

  • pnpm run typecheck-client: passed
  • pnpm run build-fast --client-only: passed
  • pnpm run valid-layers-check: passed
  • pnpm run oxlint <changed files>: passed
  • ./scripts/test.sh --runGlob '{vs/workbench/contrib/sessions/test/browser,vs/sessions/contrib/sessions/test/browser,vs/workbench/contrib/chat/test/browser/agentSessions,vs/workbench/services/configuration/test/browser,vs/workbench/contrib/chat/test/common}/**/*.test.js': 10500 passing, 31 pending

Written by GitHub Copilot on behalf of Sandeep Somavarapu (@sandy081)

@sandy081 Sandeep Somavarapu (sandy081) added this to the 1.149.0 milestone Nov 26, 2026
Copilot AI balanced review requested due to automatic review settings November 26, 2026 21:50
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: ca1568df Current: fc644840

Errored (3)

Fixtures that failed to render — no screenshot was produced.

sessions/agentsView/agentsViewlet/Viewlet/Light — [createInstance] SessionsView depends on UNKNOWN service sessionsWorkbenchScopeService.
Error: [createInstance] SessionsView depends on UNKNOWN service sessionsWorkbenchScopeService.
    at TestInstantiationService._throwIfStrict (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:392:10)
    at TestInstantiationService._createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:142:10)
    at TestInstantiationService.createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:128:18)
    at TestInstantiationService.createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts:62:16)
    at renderSessionsViewFixture (file:///home/runner/work/vscode/vscode/src/vs/sessions/contrib/sessions/test/browser/sessionsListFixtureUtils.ts:1299:56)
    at Object.render (file:///home/runner/work/vscode/vscode/src/vs/sessions/contrib/sessions/test/browser/agentsViewlet.fixture.ts:16:30)
    at async Promise.all (index 0)
    at actualRender (file:///home/runner/work/vscode/vscode/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts:1414:6)
    at Object.render (file:///home/runner/work/vscode/vscode/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts:1444:5)
    at To.waitForRendering (file:///home/runner/work/vscode/vscode/build/node_modules/.pnpm/@vscode+component-explorer@0.2.1-161/node_modules/@vscode/component-explorer/dist/viewer.js:3683:1)
    at Ss.renderFixture (file:///home/runner/work/vscode/vscode/build/node_modules/.pnpm/@vscode+component-explorer@0.2.1-161/node_modules/@vscode/component-explorer/dist/viewer.js:6904:1)
    at async <anonymous>:329:30
sessions/agentsView/agentsViewlet/ViewletScoped/Light — [createInstance] SessionsView depends on UNKNOWN service sessionsWorkbenchScopeService.
Error: [createInstance] SessionsView depends on UNKNOWN service sessionsWorkbenchScopeService.
    at TestInstantiationService._throwIfStrict (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:392:10)
    at TestInstantiationService._createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:142:10)
    at TestInstantiationService.createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:128:18)
    at TestInstantiationService.createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts:62:16)
    at renderSessionsViewFixture (file:///home/runner/work/vscode/vscode/src/vs/sessions/contrib/sessions/test/browser/sessionsListFixtureUtils.ts:1299:56)
    at Object.render (file:///home/runner/work/vscode/vscode/src/vs/sessions/contrib/sessions/test/browser/agentsViewlet.fixture.ts:16:30)
    at async Promise.all (index 0)
    at actualRender (file:///home/runner/work/vscode/vscode/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts:1414:6)
    at Object.render (file:///home/runner/work/vscode/vscode/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts:1444:5)
    at To.waitForRendering (file:///home/runner/work/vscode/vscode/build/node_modules/.pnpm/@vscode+component-explorer@0.2.1-161/node_modules/@vscode/component-explorer/dist/viewer.js:3683:1)
    at Ss.renderFixture (file:///home/runner/work/vscode/vscode/build/node_modules/.pnpm/@vscode+component-explorer@0.2.1-161/node_modules/@vscode/component-explorer/dist/viewer.js:6904:1)
    at async <anonymous>:329:30
sessions/agentsView/agentsViewlet/ViewletEmpty/Light — [createInstance] SessionsView depends on UNKNOWN service sessionsWorkbenchScopeService.
Error: [createInstance] SessionsView depends on UNKNOWN service sessionsWorkbenchScopeService.
    at TestInstantiationService._throwIfStrict (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:392:10)
    at TestInstantiationService._createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:142:10)
    at TestInstantiationService.createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/common/instantiationService.ts:128:18)
    at TestInstantiationService.createInstance (file:///home/runner/work/vscode/vscode/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts:62:16)
    at renderSessionsViewFixture (file:///home/runner/work/vscode/vscode/src/vs/sessions/contrib/sessions/test/browser/sessionsListFixtureUtils.ts:1299:56)
    at Object.render (file:///home/runner/work/vscode/vscode/src/vs/sessions/contrib/sessions/test/browser/agentsViewlet.fixture.ts:16:30)
    at async Promise.all (index 0)
    at actualRender (file:///home/runner/work/vscode/vscode/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts:1414:6)
    at Object.render (file:///home/runner/work/vscode/vscode/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts:1444:5)
    at To.waitForRendering (file:///home/runner/work/vscode/vscode/build/node_modules/.pnpm/@vscode+component-explorer@0.2.1-161/node_modules/@vscode/component-explorer/dist/viewer.js:3683:1)
    at Ss.renderFixture (file:///home/runner/work/vscode/vscode/build/node_modules/.pnpm/@vscode+component-explorer@0.2.1-161/node_modules/@vscode/component-explorer/dist/viewer.js:6904:1)
    at async <anonymous>:329:30

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.

🟡 Changes recommended

Remote windows can expose sessions from unrelated workspaces, and draft scoping can include unrelated directories while excluding matching worktrees and missing the session-folder fallback.

2 open issues
What changed in this PR

This PR adds an optional workspace/environment filter bar across all Sessions list groupings and moves workspace filtering into the new editor-window list, allowing providers to retain their full session inventories.

Changes:

  • Adds the experimental sessions.list.workspacesFilter.enabled setting and shared window-scope ownership.
  • Applies list-side scope to sessions, comparisons, and pending rows while retaining provider filtering for the legacy list.
  • Updates workspace identity matching, picker behavior, documentation, and regression tests.
File Description
src/​vs/​workbench/​services/​configuration/​test/​browser/​configurationService.test.ts Tests scope overrides and reset behavior.
src/​vs/​workbench/​services/​configuration/​common/​configuration.ts Defines the editable workspace-scope contract.
src/​vs/​workbench/​services/​configuration/​browser/​configurationService.ts Implements editor-window scope overrides.
src/​vs/​workbench/​services/​configuration/​browser/​agents/​agentsWorkspaceContextService.ts Adds mutable scope to Agents windows.
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​workspaceFolderRepositories.test.ts Adapts tests to explicit inventory-scoping options.
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​views/​sessionsWorkbenchScope.test.ts Tests shared scope ownership and cleanup.
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​views/​sessionsListFilters.test.ts Tests URI-aware matching and environment-specific deduplication.
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​editorWindow/​editorWindowSessionsProvidersService.test.ts Tests full-inventory and legacy-scope transitions.
src/​vs/​workbench/​contrib/​sessions/​common/​sessionConfig.ts Declares the workspace-filter setting ID.
src/​vs/​workbench/​contrib/​sessions/​browser/​workspaceFolderRepositories.ts Supports switching provider scope off.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsWorkbenchScope.ts Coordinates scope across registered list bars.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsView.ts Wires list-side filtering and the shared scope bar.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsListFilters.ts Synchronizes selections and uses URI identity comparisons.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsList.ts Applies scope across groupings and list operations.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsInboxScope.ts Generalizes picker labels and workspace choices.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​pendingSessions.ts Uses shared workspace identity matching for pending rows.
src/​vs/​workbench/​contrib/​sessions/​browser/​sessionScope.ts Extracts reusable session-scope matching.
src/​vs/​workbench/​contrib/​sessions/​browser/​sessionsConfiguration.ts Registers the experimental filter-bar setting.
src/​vs/​workbench/​contrib/​sessions/​browser/​editorWindow/​editorWindowSessionsProvidersService.ts Connects provider scope to new-list enablement.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHost/​agentHostSessionListStoreProjectRoot.test.ts Tests agent-host inventory transitions.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostSessionListStore.ts Adds reactive full-inventory listing.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostSessionListContribution.ts Passes list enablement into the host store.
src/​vs/​sessions/​SESSIONS_LIST.md Documents list-side scope and shared bar behavior.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​sessionsViewMenu.test.ts Tests picker choices and grouping-specific labels.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​sessionsList.test.ts Tests list-side scope and strict filtering across groupings.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​sessionsInboxScope.fixture.ts Adapts the fixture to new picker inputs.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​pendingSessionsList.test.ts Tests pending-row filtering with bar and window scopes.
src/​vs/​sessions/​contrib/​sessions/​browser/​sessions.contribution.ts Registers the setting in the Agents window.

Review effort: Balanced


this._isSessionsWindow = environmentService.isSessionsWindow;
this._surfacesAllAgents = chatViewSessionsListService.surfacesAllLocalAgentHostAgents;
this._listAllSessions = chatViewSessionsListService.enabled;
Comment on lines +467 to +469
const folder = session.mainChat.read(reader).workspace.read(reader)?.folders[0];
if (folder) {
folders.push(folder.workingDirectory);
@sandy081
Sandeep Somavarapu (sandy081) force-pushed the sandy081/agents/infra-workspaces-filter branch 2 times, most recently from 44291af to bcc3df9 Compare November 26, 2026 23:17
Keep complete core provider inventories for the new editor Sessions list and apply window and picker scope in the list. Preserve legacy provider filtering and coordinate picker-selected workbench scope across list instances.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Editor-window providers drop workspace scoping only while both the new
Sessions list and sessions.list.workspacesFilter.enabled are on, so
getSessions() consumers in folder windows don't change while the setting
is off. The setting key now lives in ChatConfiguration so contrib/chat
doesn't import contrib/sessions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Store the workspace/environment pick per window (workspace storage), so each window keeps its own pick.
- Scope the window from the bar only while it is shown (AI features enabled and not hidden).
- Offer the bar's workspaces from the sessions the list includes, before the bar's own pick.
- Share one reading of the window's folders and repositories between the providers and the Sessions lists.
- Dedupe the folders that scope pending sessions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… and the Agents window

Folder and multi-root editor windows keep their own scope, so the bar no
longer offers or applies the window's folders there.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Folder windows with sessions.list.workspacesFilter.enabled on show no
workspaces bar, so they keep the Environment submenu and environment
inclusion instead of following an invisible bar pick.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The workspaces filter pick is now stored per window. Remove the value that
earlier builds stored for the whole profile instead of migrating it, so no
window starts on another window's pick.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sandy081
Sandeep Somavarapu (sandy081) force-pushed the sandy081/agents/infra-workspaces-filter branch from bcc3df9 to fb32c81 Compare November 27, 2026 00:28
Export windowShowsSessionsScopeBar (the Agents window and empty editor
windows) and expose it as windowShowsBar, so the workspaces filter bar
and Inbox's bar share one rule.

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

This branch has not been deployed

No deployments
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.

2 participants