Default editor and panel chat to Agent Host Copilot when the agent host is enabled#326086
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
df5d538 to
de47fb3
Compare
f80dfbb to
7a5a9f6
Compare
76730ce to
48bfb79
Compare
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>
…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>
c5b7526 to
c38e576
Compare
pwang347
approved these changes
Jul 16, 2026
connor4312
approved these changes
Jul 17, 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
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
agentHostEnabledflag (fromIAgentHostEnablementService) through the default-session-type resolution and its callers.ChatViewPanesession resolution is now cancelable.smoketest.openLocalChatcommand for Local panel smoke scenarios; the sandbox reopen path reveals the existing local session to avoid a focus race.IAgentHostEnablementServicestub 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_terminalshell-prompt artifact (#303531), which passes in CI's clean shell.