sessions: experimental setting for local agent host as default provider#319653
Merged
sandy081 merged 2 commits intoJun 2, 2026
Conversation
Introduce an experimental `chat.agentHost.defaultSessionsProvider` setting (default `false`, gated behind `chat.agentHost.enabled`). When enabled, the local agent host's session types are surfaced before other providers'. Ordering is driven by a new `order` property on `ISessionsProvider` (lower sorts first, default `0`, ties keep registration order) so the management service stays provider-agnostic. The local agent host provider sets its order reactively from the setting and fires `onDidChangeSessionTypes` on change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an experimental mechanism for controlling which Sessions provider’s session types appear first in the Agents window by pushing provider precedence into the provider contract (ISessionsProvider.order) and sorting providers in the sessions management layer accordingly. It also introduces an experimental setting (chat.agentHost.defaultSessionsProvider) that, when enabled, makes the local agent host provider surface its session types ahead of others.
Changes:
- Add a required
ISessionsProvider.orderproperty and sort providers by this order (stable) when collecting/session-filtering session types. - Make the local agent host provider’s
orderreactive to the new experimental setting and trigger resorting by firingonDidChangeSessionTypes. - Update docs and add unit tests asserting ordering behavior.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/SESSIONS.md | Documents provider order and the experimental setting behavior. |
| src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts | Adds tests to assert session type ordering by provider order. |
| src/vs/sessions/services/sessions/common/sessionsProvider.ts | Introduces required order: number on ISessionsProvider. |
| src/vs/sessions/services/sessions/browser/sessionsManagementService.ts | Implements provider ordering via _getOrderedProviders() and applies it to type collection/filtering. |
| src/vs/sessions/contrib/providers/localChatSessions/browser/localChatSessionsProvider.ts | Sets explicit provider order = 0. |
| src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts | Sets explicit provider order = 0. |
| src/vs/sessions/contrib/providers/agentHost/browser/localAgentHostSessionsProvider.ts | Makes provider order reactive to the experimental setting and re-fires type-change events on toggle. |
| src/vs/sessions/contrib/providers/agentHost/browser/localAgentHost.contribution.ts | Registers the new experimental setting for local agent host default-provider behavior. |
| src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts | Provides a default order implementation for agent-host-backed providers. |
| src/vs/sessions/contrib/chat/test/browser/sessionWorkspacePicker.test.ts | Updates test provider mocks to include required order. |
| src/vs/sessions/common/agentHostSessionsProvider.ts | Adds the exported setting id constant for chat.agentHost.defaultSessionsProvider. |
Copilot's findings
- Files reviewed: 11/11 changed files
- Comments generated: 1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mjbvz
approved these changes
Jun 2, 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.
What
Adds an experimental setting
chat.agentHost.defaultSessionsProvider(defaultfalse, gated behindchat.agentHost.enabled). When enabled, the local agent host becomes the default sessions provider: its session types are surfaced before every other provider's in the Agents window (new-session picker, type filter, etc.). When disabled, the Copilot Chat sessions provider keeps precedence (current behavior).How
Rather than hardcoding provider ordering in the orchestration layer, ordering now flows through the provider contract:
ISessionsProvider.order— new requirednumberproperty. Lower values sort first; default0; ties keep registration order.SessionsManagementService—_getOrderedProviders()does a stable sort byorderand is used by bothgetAllSessionTypes()andgetSessionTypesForFolder(). The management service stays provider-agnostic.BaseAgentHostSessionsProviderdefaultsorderto0.LocalAgentHostSessionsProvideroverridesorderto return-1when the setting is enabled (else1), and firesonDidChangeSessionTypeswhen the setting toggles so the list re-sorts live.CopilotChatSessionsProvider/LocalChatSessionsProviderset explicitorder = 0.tags: ['experimental']+experiment: { mode: 'startup' }).Notes for reviewers
src/vs/sessions/common/agentHostSessionsProvider.ts.SessionsManagementServicenow initializes its session-types cache at construction.order. UpdatedSESSIONS.md.Validated with
compile-check-ts-native,valid-layers-check, hygiene, and the affected browser unit tests.