Skip to content

Default editor and panel chat to Agent Host Copilot when the agent host is enabled#326086

Merged
TylerLeonhardt merged 3 commits into
mainfrom
tyleonha/agent-host-copilot-editor-default
Jul 17, 2026
Merged

Default editor and panel chat to Agent Host Copilot when the agent host is enabled#326086
TylerLeonhardt merged 3 commits into
mainfrom
tyleonha/agent-host-copilot-editor-default

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Jul 16, 2026

Copy link
Copy Markdown
Member

What

Stacked on #326178 (base: tyleonha/prefer-copilot-harness). Review that PR first; this PR shows only the feature-2 delta.

Makes Agent Host Copilot the computed default chat provider for both editor and panel chat whenever the agent host is enabled, so first-time users land on Copilot instead of Local. chat.editor.preferCopilotHarness (from the base PR) stays scoped to the one-time Local -> Copilot migration only.

Changes

  • Thread an agentHostEnabled flag (from IAgentHostEnablementService) through the default-session-type resolution and its callers.
  • Keep Local visible and selectable; honor explicit and remembered selections.
  • New Local Chat opens a local session directly: it cancels the in-flight default-provider resolution (which would otherwise block on agent host activation) so the local request wins immediately. The initial ChatViewPane session resolution is now cancelable.
  • Open a Local chat first in all chat participant API tests, since chat participants are a Local-harness feature (this also prevents those tests hanging on remote).
  • Add a smoketest.openLocalChat command for Local panel smoke scenarios; the sandbox reopen path reveals the existing local session to avoid a focus race.
  • Register an IAgentHostEnablementService stub in the component fixtures.

Verification

Local runs (darwin): constants unit (20) and chatEditorInput unit (3) pass; Electron + remote api chat participant/title tests pass; Chat Sandbox / Sessions / Model Config / Disabled smoke suites pass; component fixtures render clean. The only local failures are the known run_in_terminal shell-prompt artifact (#303531), which passes in CI's clean shell.

Copilot AI review requested due to automatic review settings July 16, 2026 01:23

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

Makes Agent Host Copilot the default editor and panel chat provider when Agent Host is enabled.

Changes:

  • Threads Agent Host enablement through chat session resolution.
  • Explicitly opens Local chat for Local-harness tests.
  • Spawns and connects a real Agent Host in remote integration tests.
Show a summary per file
File Description
test/smoke/src/areas/chat/chatSessions.test.ts Opens Local smoke sessions explicitly.
test/smoke/src/areas/chat/chatSandbox.test.ts Uses Local for sandbox scenarios.
test/smoke/src/areas/chat/chatModelConfig.test.ts Uses Local for model configuration tests.
test/smoke/extensions/vscode-smoketest-ext-host/package.json Contributes the Local test command.
test/smoke/extensions/vscode-smoketest-ext-host/extension.js Implements Local chat opening.
src/vs/workbench/contrib/chat/test/common/constants.test.ts Expands default-provider resolution tests.
src/vs/workbench/contrib/chat/test/browser/widgetHosts/editor/chatEditorInput.test.ts Supplies Agent Host enablement in tests.
src/vs/workbench/contrib/chat/common/constants.ts Revises default session resolution.
src/vs/workbench/contrib/chat/common/chatSessionTypePreference.ts Stores the one-time migration marker.
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts Applies defaults to panel chat.
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts Applies defaults to editor chat.
src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.ts Updates picker defaults and preferences.
src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.ts Threads the enablement service.
src/vs/workbench/contrib/chat/browser/actions/chatNewActions.ts Threads enablement into new-chat actions.
src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts Preserves provider selection when forwarding.
src/vs/workbench/contrib/chat/browser/actions/chatClear.ts Uses computed defaults when clearing editors.
src/vs/workbench/contrib/chat/browser/actions/chatActions.ts Resolves and opens new session types.
src/vs/server/node/agentHostChannel.ts Retries Agent Host WebSocket connections.
src/vs/platform/agentHost/common/agentHostEnablementService.ts Replaces the default-provider setting.
scripts/test-remote-integration.sh Enables Agent Host in Unix remote tests.
scripts/test-remote-integration.bat Enables Agent Host in Windows remote tests.
extensions/vscode-test-resolver/src/extension.ts Allocates and passes an Agent Host port.
extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts Opens Local before participant API tests.

Review details

  • Files reviewed: 23/23 changed files
  • Comments generated: 5
  • Review effort level: Medium

Comment thread src/vs/workbench/contrib/chat/common/constants.ts Outdated
Comment thread src/vs/workbench/contrib/chat/browser/actions/chatActions.ts Outdated
Comment thread src/vs/server/node/agentHostChannel.ts Outdated
Comment thread extensions/vscode-test-resolver/src/extension.ts Outdated
Comment thread src/vs/server/node/agentHostChannel.ts Outdated
@TylerLeonhardt TylerLeonhardt force-pushed the tyleonha/agent-host-copilot-editor-default branch 6 times, most recently from df5d538 to de47fb3 Compare July 16, 2026 17:12
@TylerLeonhardt TylerLeonhardt changed the base branch from main to tyleonha/prefer-copilot-harness July 16, 2026 17:12
@TylerLeonhardt TylerLeonhardt force-pushed the tyleonha/prefer-copilot-harness branch from f80dfbb to 7a5a9f6 Compare July 16, 2026 17:49
@TylerLeonhardt TylerLeonhardt force-pushed the tyleonha/agent-host-copilot-editor-default branch 2 times, most recently from 76730ce to 48bfb79 Compare July 16, 2026 18:23
TylerLeonhardt added a commit that referenced this pull request Jul 16, 2026
Fixes the New Chat drop bug (review comment #2 on #326086): when the
agent host is enabled the computed default is a non-local harness, so the
editor clear path recomputed that default and dropped explicit or
preserved local requests.

- clearChatSessionPreservingType now branches on the resolved session
  type for the sidebar (non-local -> loadSession, local ->
  startNewLocalSession) so a generic New Chat from a Local panel
  preserves Local, consistent with contributed panels.
- The resolved type is threaded through IChatWidget.clear ->
  viewOptions.clear -> chatEditor.clear -> clearChatEditor so the editor
  opens a session of that type instead of recomputing the default. This
  restores explicit "New Local Chat" from a non-local editor.
- clearChatEditor applies an explicit target type directly and keeps its
  swap-aware default only for direct (untargeted) calls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Base automatically changed from tyleonha/prefer-copilot-harness to main July 16, 2026 20:04
TylerLeonhardt and others added 3 commits July 16, 2026 13:08
…st is enabled

Builds on the chat.editor.preferCopilotHarness behavior to make Agent Host
Copilot the computed default chat provider for both editor and panel chat
whenever the agent host is enabled, so first-time users land on Copilot instead
of Local. chat.editor.preferCopilotHarness stays scoped to the one-time
Local -> Copilot migration only.

- Thread an agentHostEnabled flag (from IAgentHostEnablementService) through the
  default-session-type resolution and its callers.
- Keep Local visible and selectable; honor explicit and remembered selections.
- New Local Chat opens a local session directly: it cancels the in-flight
  default-provider resolution (which would otherwise block on agent host
  activation) so the local request wins immediately.
- Open a Local chat first in all chat participant API tests, since chat
  participants are a Local-harness feature.
- Add a smoketest.openLocalChat command for Local panel smoke scenarios; the
  sandbox reopen path reveals the existing local session to avoid a focus race.
- Register an IAgentHostEnablementService stub in the component fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes the New Chat drop bug (review comment #2 on #326086): when the
agent host is enabled the computed default is a non-local harness, so the
editor clear path recomputed that default and dropped explicit or
preserved local requests.

- clearChatSessionPreservingType now branches on the resolved session
  type for the sidebar (non-local -> loadSession, local ->
  startNewLocalSession) so a generic New Chat from a Local panel
  preserves Local, consistent with contributed panels.
- The resolved type is threaded through IChatWidget.clear ->
  viewOptions.clear -> chatEditor.clear -> clearChatEditor so the editor
  opens a session of that type instead of recomputing the default. This
  restores explicit "New Local Chat" from a non-local editor.
- clearChatEditor applies an explicit target type directly and keeps its
  swap-aware default only for direct (untargeted) calls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assigning a new CancellationTokenSource to the MutableDisposable only
disposes the previous source, and disposing a CancellationTokenSource
does not cancel it. So a re-entrant applyModel() (view render, switch
session) left the prior in-flight resolution running, racing to call
showModel with a stale result. Cancel the previous source explicitly
before replacing it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TylerLeonhardt TylerLeonhardt force-pushed the tyleonha/agent-host-copilot-editor-default branch from c5b7526 to c38e576 Compare July 16, 2026 20:10
@TylerLeonhardt TylerLeonhardt marked this pull request as ready for review July 16, 2026 22:00
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) July 16, 2026 22:00
@TylerLeonhardt TylerLeonhardt merged commit 505665a into main Jul 17, 2026
32 of 54 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyleonha/agent-host-copilot-editor-default branch July 17, 2026 00:15
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 17, 2026

@javi0guerrero4-cloud javi0guerrero4-cloud left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a good idea

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.

5 participants