Default editor chat to Agent Host Copilot when the agent host is enabled#326001
Draft
TylerLeonhardt with Copilot wants to merge 8 commits into
Draft
Default editor chat to Agent Host Copilot when the agent host is enabled#326001TylerLeonhardt with Copilot wants to merge 8 commits into
TylerLeonhardt with Copilot wants to merge 8 commits into
Conversation
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update chat.editor.defaultProvider to favor AH in ExP
Prefer Copilot harness once for editor sessions
Jul 15, 2026
Make AgentHostCopilot the computed default editor chat provider whenever the agent host is enabled, so first-time users land on Copilot instead of the local harness. The 'chat.editor.preferCopilotHarness' setting is kept solely for the one-time Local->Copilot swap in resolveDefaultNewChatSessionType. Thread an agentHostEnabled flag (sourced from IAgentHostEnablementService, the only sanctioned reader of chat.agentHost.enabled) through the session default helper family, and drop the preferCopilotHarness branches from getComputedDefaultSessionType and isVisibleEditorChatSessionType so Local stays visible/selectable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates editor-session harness selection to prefer Agent Host Copilot while preserving remembered choices and applying a one-time Local migration.
Changes:
- Replaces
chat.editor.defaultProviderwithchat.editor.preferCopilotHarness. - Adds profile-scoped migration state and Agent Host-aware default resolution.
- Propagates Agent Host enablement through chat actions, pickers, editors, and tests.
Show a summary per file
| File | Description |
|---|---|
src/vs/platform/agentHost/common/agentHostEnablementService.ts |
Registers the new preference setting. |
src/vs/workbench/contrib/chat/common/chatSessionTypePreference.ts |
Persists one-time migration state. |
src/vs/workbench/contrib/chat/common/constants.ts |
Implements harness selection logic. |
src/vs/workbench/contrib/chat/browser/actions/chatActions.ts |
Uses the stateful resolver for new sessions. |
src/vs/workbench/contrib/chat/browser/actions/chatClear.ts |
Applies enablement-aware editor defaults. |
src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts |
Passes Agent Host enablement when clearing. |
src/vs/workbench/contrib/chat/browser/actions/chatNewActions.ts |
Passes enablement for New Chat. |
src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.ts |
Propagates the enablement service. |
src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.ts |
Records enablement-aware selections. |
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts |
Resolves editor defaults using enablement. |
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts |
Updates view-session default handling. |
src/vs/workbench/contrib/chat/test/browser/widgetHosts/editor/chatEditorInput.test.ts |
Updates editor input fixtures. |
src/vs/workbench/contrib/chat/test/common/constants.test.ts |
Covers defaults, opt-outs, and migration state. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 3
- Review effort level: Medium
… Local - Gate the one-time Local->Copilot swap in resolveDefaultNewChatSessionType on agentHostEnabled, so it no longer returns an unresolvable Agent Host URI (or permanently marks the transition) when the agent host is disabled (e.g. web). - Make the empty-Local replacement decisions honor a remembered Local opt-out by using the remembered-aware getDefaultNewChatSessionType/Resource instead of the computed default, in both ChatEditorInput.shouldReplaceEmptyLocalSession and ChatViewPane.shouldSkipRestoredLocalSession. - Refresh the stale acquireDefaultNewSession doc comment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The editor/panel chat now defaults to Agent Host Copilot when the agent host is enabled, which broke tests that assumed the local participant harness was the default. - Integration (API) tests launch with --disable-extensions and no Copilot infrastructure, so an agent-host default session cannot be resolved (its activation blocks). Seed chat.agentHost.enabled=false in the integration launch settings so the local harness stays the default there. - Smoke tests keep the agent host enabled (other scenarios exercise it) and now open the Local panel explicitly via a new smoketest.openLocalChat command that reveals the panel and runs workbench.action.chat.newLocalChat. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When the agent host is enabled the computed default is a non-local harness, so 'New Local Chat' (clearChatSessionPreservingType with an explicit local override) fell through to widget.clear(), which re-acquired the non-local default and left the panel on Copilot. Start a local session explicitly instead so the explicit request is honored. This also restores the local participant flow for the vscode-api-tests chat title-provider test without disabling the agent host: the test now opens the panel and switches to Local via workbench.action.chat.newLocalChat. Revert the earlier chat.agentHost.enabled=false integration-launch workaround. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Chat participants are a Local-harness feature, but the panel now defaults to Agent Host Copilot when the agent host is enabled. Factor the open-and-switch into a shared openLocalChat() helper and use it in every participant test so they consistently exercise the local participant pipeline, not just the title provider test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The chatDisabled smoke test flags any palette command whose label contains 'Chat'/'Agent'/'Copilot'/'MCP' when AI features are disabled. Rename the command title from 'Open Local Chat Session' to 'Open Local Test Session', matching the existing 'Open CLI/Claude Test Session' commands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Makes Agent Host Copilot the default editor chat provider when the agent host is enabled, so first-time users start on Copilot instead of the Local harness. Local remains fully visible and selectable, and any explicit or remembered choice still wins.
The default is now driven by
chat.agentHost.enabled(read only viaIAgentHostEnablementService). The experimentalchat.editor.preferCopilotHarnesssetting is kept, but only for the one-time Local→Copilot migration.Default provider for a new editor chat (no remembered/current selection)
chat.agentHost.enabledchat.editor.localAgent.enabledAny explicit override or remembered (previously picked) selection takes precedence over the table above. A remembered Local selection is honored as a real opt-out: empty Local sessions are no longer auto-replaced/skipped in its favor (both the editor and the sidebar).
chat.editor.preferCopilotHarness(one-time migration)Only has an effect when the agent host is enabled. It migrates an existing user off Local exactly once:
Other behavior changes
preferCopilotHarnessis now scoped only to the one-time migration. It no longer controls the default provider (that is nowchat.agentHost.enabled) and no longer affects picker visibility.chat.editor.localAgent.enabled. Local is hidden when that setting isfalseand a non-local provider is available; it stays visible in virtual workspaces or when it would otherwise be the only option. Previously,preferCopilotHarness+ a disabled local agent could hide Local unconditionally, even as the last-resort option.