Skip to content

Default editor chat to Agent Host Copilot when the agent host is enabled#326001

Draft
TylerLeonhardt with Copilot wants to merge 8 commits into
mainfrom
copilot/update-chat-editor-default-provider
Draft

Default editor chat to Agent Host Copilot when the agent host is enabled#326001
TylerLeonhardt with Copilot wants to merge 8 commits into
mainfrom
copilot/update-chat-editor-default-provider

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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 via IAgentHostEnablementService). The experimental chat.editor.preferCopilotHarness setting is kept, but only for the one-time Local→Copilot migration.

Default provider for a new editor chat (no remembered/current selection)

chat.agentHost.enabled chat.editor.localAgent.enabled Default
true (any) Agent Host Copilot
false true Local
false false First visible non-local provider, else Local

Any 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:

Interaction Behavior
First "New Chat" from a Local session (setting on, not yet applied) Switch to Agent Host Copilot once, then persist a per-profile "applied" flag
Every interaction after that No further auto-switch — remembered/current selection wins (returning to Local stays Local)
Agent host disabled (e.g. web) Swap never fires — no unresolvable Agent Host URI and the flag is not written

Other behavior changes

  • preferCopilotHarness is now scoped only to the one-time migration. It no longer controls the default provider (that is now chat.agentHost.enabled) and no longer affects picker visibility.
  • Local's visibility is governed solely by chat.editor.localAgent.enabled. Local is hidden when that setting is false and 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.

Copilot AI requested review from Copilot and removed request for Copilot July 15, 2026 16:43
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 15, 2026 16:57
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
Copilot AI requested a review from TylerLeonhardt July 15, 2026 16:58
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>
Copilot AI review requested due to automatic review settings July 15, 2026 21:44

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

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.defaultProvider with chat.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

Comment thread src/vs/workbench/contrib/chat/common/constants.ts
Comment thread src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts Outdated
Comment thread src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts Outdated
… 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>
@TylerLeonhardt TylerLeonhardt changed the title Prefer Copilot harness once for editor sessions Default editor chat to Agent Host Copilot when the agent host is enabled Jul 15, 2026
TylerLeonhardt and others added 4 commits July 15, 2026 15:55
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>
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.

3 participants