Repository navigation
Turn off the legacy Copilot CLI session provider (behind an exp) and migrate its sessions to Agent Host - #346729
Merged
Merged
Conversation
… make legacy session migration unconditional
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The change leaves a stale context key that can hide the enabled CLI provider’s UI and unnecessarily probes unsaved drafts, potentially delaying new-session opening by 60 seconds.
2 open issues
What changed in this PR
Prepares the transition from the extension-host Copilot CLI provider to Agent Host by adding a rollout setting and making legacy session migration unconditional.
Changes:
- Adds an experiment-controlled setting to disable the legacy provider and hide its session type and delete command.
- Removes migration gates, configuration forwarding, restart handling, and related telemetry fields.
- Updates unit tests and smoke coverage for the Agent Host path.
| File | Description |
|---|---|
test/smoke/src/main.ts |
Removes legacy CLI smoke-suite registration. |
test/smoke/src/areas/chat/copilotCli.test.ts |
Deletes the legacy CLI smoke suite. |
test/smoke/src/areas/chat/chatSessions.test.ts |
Removes legacy scenarios and disables the provider. |
test/smoke/src/areas/browserView/browserView.test.ts |
Disables the legacy provider in smoke settings. |
test/smoke/src/areas/agentsWindow/agentsWindow.test.ts |
Disables the legacy provider in smoke settings. |
test/smoke/extensions/vscode-smoketest-ext-host/package.json |
Removes the legacy session-opening command contribution. |
test/smoke/extensions/vscode-smoketest-ext-host/extension.js |
Removes the legacy session-opening command handler. |
src/vs/workbench/contrib/sessions/providers/agentHost/browser/localAgentHostSessionsProvider.ts |
Removes the migration gate from resource resolution. |
src/vs/workbench/contrib/relauncher/browser/relauncher.contribution.ts |
Removes migration-setting restart handling. |
src/vs/workbench/contrib/chat/test/common/constants.test.ts |
Tests fallback for explicit legacy CLI requests. |
src/vs/workbench/contrib/chat/test/browser/widgetHosts/editor/chatEditorInput.test.ts |
Updates editor migration setup. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionsOpener.test.ts |
Updates session-opening migration setup. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostLegacyMigration.test.ts |
Updates migration behavior and telemetry expectations. |
src/vs/workbench/contrib/chat/common/constants.ts |
Removes the migration key and rejects legacy new-chat overrides. |
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts |
Makes editor migration probing unconditional. |
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts |
Removes migration-setting registration and forwarding. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.ts |
Removes migration gates from session opening. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLegacyMigration.ts |
Removes startup gating and gate-related telemetry. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.ts |
Removes startup migration-gate initialization. |
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts |
Updates legacy resource-resolution setup. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Tests unconditional legacy discovery. |
src/vs/platform/agentHost/test/node/agentService.test.ts |
Updates discovery, listing, adoption, and diagnostic expectations. |
src/vs/platform/agentHost/test/node/agentHostStartupPerformance.test.ts |
Replaces the removed migration metric in assertions. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Removes legacy discovery gating and related metrics. |
src/vs/platform/agentHost/node/agentService.ts |
Makes legacy discovery, listing, and adoption unconditional. |
src/vs/platform/agentHost/node/agentHostStartupPerformance.ts |
Removes the migration-enabled startup metric. |
src/vs/platform/agentHost/node/agentHostBootstrap.ts |
Removes migration-gate initialization. |
src/vs/platform/agentHost/common/agentHostSchema.ts |
Removes the host migration configuration key and schema. |
src/vs/platform/agentHost/common/agent.ts |
Removes migration options from discovery contracts. |
extensions/copilot/src/platform/configuration/common/configurationService.ts |
Defines the experiment-based legacy-provider setting. |
extensions/copilot/src/extension/chatSessions/vscode-node/chatSessions.ts |
Gates legacy provider registration and visibility. |
extensions/copilot/package.nls.json |
Adds the legacy-provider setting description. |
extensions/copilot/package.json |
Registers the setting and conditional contribution visibility. |
Review effort: Balanced
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
ChatSessionsContrib resolves IConfigurationService and IExperimentationService through invokeFunction instead of constructor injection, hiding dependencies and bypassing constructor dependency ordering.
1 open issue
2 resolved since last review
Review effort: Balanced
Vijay Upadya (vijayupadya)
marked this pull request as ready for review
November 10, 2026 07:13
Vijay Upadya (vijayupadya)
enabled auto-merge (squash)
November 10, 2026 07:13
Ladislau Szomoru (lszomoru)
approved these changes
Nov 10, 2026
Bryan Chen (bryanchen-d)
added a commit
that referenced
this pull request
Nov 10, 2026
Since #346729 removed the Copilot CLI row, Test Local session is the first test of the Chat Sessions suite and runs in a cold window. There, smoketest.openLocalChat still waits for workbench.action.chat.newLocalChat to register while the chat view binds its default Agent Host Copilot session. waitForChatViewSessionChange accepted that binding, so the prompt went to the Agent Host session and the local reply never came (13 Linux smoke failures on 12 unrelated PRs since). Use waitForNewLocalChatViewSession, as the other local chat suites do since #345913, and remove the looser wait, which has no other callers. Co-authored-by: Copilot <[email protected]>
Bryan Chen (bryanchen-d)
added a commit
that referenced
this pull request
Nov 11, 2026
…347394) Since #346729 removed the Copilot CLI row, Test Local session is the first test of the Chat Sessions suite and runs in a cold window. There, smoketest.openLocalChat still waits for workbench.action.chat.newLocalChat to register while the chat view binds its default Agent Host Copilot session. waitForChatViewSessionChange accepted that binding, so the prompt went to the Agent Host session and the local reply never came (13 Linux smoke failures on 12 unrelated PRs since). Use waitForNewLocalChatViewSession, as the other local chat suites do since #345913, and remove the looser wait, which has no other callers. Co-authored-by: Copilot <[email protected]>
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.

Prepares for removing the legacy extension-host Copilot CLI provider with a controlled rollout.
github.copilot.chat.cli.legacyProvider.enabled(default on). When off, the extension does not register the extension-host Copilot CLI provider, and thecopilotclisession type and its delete command are hidden. Its sessions open in the Agent Host, which migrates them in place.chat.agentSessions.migrateLegacyCopilotCli(setting, restart prompt, and the value forwarded to the Agent Host). The Agent Host ignores the key if an older client still sends it.The SDK and provider code stay in this change; they are removed separately once the experiment is fully rolled out.
Validation
srctype check: passedagentService,copilotAgent,agentHostLegacyMigration,agentSessionsOpener,chatEditorInput,localAgentHostSessionsProvider): 3163 passed