Skip to content

Turn off the legacy Copilot CLI session provider (behind an exp) and migrate its sessions to Agent Host - #346729

Merged
Vijay Upadya (vijayupadya) merged 5 commits into
mainfrom
legacy-cli-provider-exp
Nov 10, 2026
Merged

Vijay Upadya (vijayupadya) merged 5 commits into
mainfrom
legacy-cli-provider-exp

Conversation

@vijayupadya

Copy link
Copy Markdown
Contributor

Prepares for removing the legacy extension-host Copilot CLI provider with a controlled rollout.

  • Adds the experiment-based setting github.copilot.chat.cli.legacyProvider.enabled (default on). When off, the extension does not register the extension-host Copilot CLI provider, and the copilotcli session type and its delete command are hidden. Its sessions open in the Agent Host, which migrates them in place.
  • Makes legacy session migration unconditional and removes 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

  • Extension type check and configuration specs: passed
  • src type check: passed
  • Unit tests for the Agent Host and client migration paths (agentService, copilotAgent, agentHostLegacyMigration, agentSessionsOpener, chatEditorInput, localAgentHostSessionsProvider): 3163 passed
  • ESLint on changed files: passed
  • Manual: with the setting off, legacy sessions list as Agent Host rows and open migrated

… make legacy session migration unconditional
Copilot AI balanced review requested due to automatic review settings November 7, 2026 05:30
@vijayupadya Vijay Upadya (vijayupadya) changed the title Gate the extension-host Copilot CLI provider behind an experiment and make legacy session migration unconditional Gate the EH Copilot CLI provider behind an exp and make legacy session migration unconditional Nov 7, 2026

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.

🟡 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

@vijayupadya Vijay Upadya (vijayupadya) changed the title Gate the EH Copilot CLI provider behind an exp and make legacy session migration unconditional Turn off the legacy Copilot CLI session provider (behind an exp) and migrate its sessions to Agent Host Nov 10, 2026

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.

🟡 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

@vijayupadya
Vijay Upadya (vijayupadya) marked this pull request as ready for review November 10, 2026 07:13
@vijayupadya
Vijay Upadya (vijayupadya) merged commit 8f6a1ed into main Nov 10, 2026
94 of 96 checks passed
@vijayupadya
Vijay Upadya (vijayupadya) deleted the legacy-cli-provider-exp branch November 10, 2026 07:27
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone 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]>
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