Repository navigation
Description
Issue description
The Upgrade agent hits a blocking issue when the Upgrade MCP server launches its own Copilot process for internal LLM work. The server and local CLI runtime cannot complete their protocol handshake, so the modernization workflow stops at task execution and cannot continue.
Seems to be a regression as the same setup is working with Copilot CLI 1.0.112.
Environment
- Windows 11, GitHub Copilot CLI 1.0.114 (WinGet, auto-updated from 1.0.112 → 1.0.113 on 2026-11-17)
- upgrade-agent plugin 1.1.816 →
Microsoft.GitHubCopilot.Upgrade.Mcp@1.1.816, which bundlesGitHub.Copilot.SDK1.0.11
Symptom
Whenever the Upgrade MCP server falls back to the nested CLI for an internal LLM request (for example, when start_task re-parses plan.md and MCP sampling isn't used), start_task returns:
The nested Copilot CLI could not be started (InvalidOperationException, HRESULT 0x80131509). Verify COPILOT_CLI_PATH points to a compatible copilot executable ...
Task complete
The .NET 10 upgrade is blocked before code execution: Upgrade-start_task fails because the MCP server cannot launch its nested Copilot CLI. The executable itself is present and reports version 1.0.114, but the running server's environment cannot be updated safely in-session. No project files were changed. To resume, set this in PowerShell before launching the host/MCP server, then fully exit and restart the host from that same shell so it inherits the variable:
$env:COPILOT_CLI_PATH = 'C:\Users\admin\AppData\Local\Microsoft\WinGet\Packages\GitHub.Copilot_Microsoft.Winget.Source_8wekyb3d8bbwe\copilot.exe'
Root cause
CopilotClient.StartAsync → VerifyProtocolVersionAsync throws:
SDK protocol version mismatch: SDK supports versions 3-3, but server reports version 4.
Copilot CLI 1.0.113 changed SDK_PROTOCOL_VERSION and MIN_PROTOCOL_VERSION from 3 to 4. Its server now reports protocolVersion: 4. GitHub.Copilot.SDK 1.0.11 accepts only 3. The newest public GitHub.Copilot.SDK on NuGet (1.0.34) also accepts only 3.
Repro
Run an Upgrade-agent modernization workflow with Copilot CLI 1.0.113 or later. After the assessment and plan are created, continue to the first task. When start_task needs internal LLM work and the Upgrade MCP server launches its own Copilot process, the protocol handshake fails and the workflow cannot proceed.
The same Upgrade workflow is working correctly with downgraded Copilot CLI 1.0.112.
Additional findings
CopilotCli.CreateStartFailureExceptiondropsex.Message. Users only see the exception type and HRESULT, so the actual cause is hidden.- The guidance to set
COPILOT_CLI_PATHdoesn't help in this case. The Copilot CLI already setsCOPILOT_CLI_PATHto its own executable for child processes. It also overwrites any value inherited from the shell (setRuntimeCliPath), so a user-set value never reaches the MCP server.
Possible fix
- Ship an Upgrade MCP build with an SDK that supports protocol 4. The fix may also need a .NET SDK release, or CLI-side backward compatibility for protocol 3.
- Include the inner exception message in the start-failure error.
Workaround
Pin the Copilot CLI to 1.0.112 and disable auto-update (COPILOT_AUTO_UPDATE=false).
[Environment]::SetEnvironmentVariable('COPILOT_AUTO_UPDATE', 'false', 'User')
winget install --id GitHub.Copilot --version 1.0.112 --force --accept-source-agreements --accept-package-agreements copilot --no-auto-update --version
Activity
cpeddle commentedon Nov 18, 2026
Same failure here, with three findings that may help.
Environment: Windows 11, Copilot CLI 1.0.114 (npm global install), upgrade-agent plugin 1.1.784 (
Microsoft.GitHubCopilot.Upgrade.Mcp@1.1.784, bundledGitHub.Copilot.SDK1.0.11). So this is not limited to 1.1.816.1. A run on 1.0.114 worked, because it used MCP sampling. The first headless run (
copilot --agent upgrade-agent:upgrade -p ... --allow-all-tools --no-ask-user --autopilot) calledstart_tasktwice successfully. Its log has 12Received MCP sampling request from server Upgradelines. Every run since then, on two different repos, logged 0 sampling requests and failed with the nested-CLI error: headless with--allow-all-tools, headless with--allow-all, and an interactivecopilot --agent upgrade-agent:upgradesession, which showed no sampling approval prompt. The CLI version and plugin version were the same throughout. The only difference I found is that the working run was the first one, on a cold NuGet cache (the MCP package was downloaded during it). It looks like the host stops advertising the sampling capability to the Upgrade server, so the server never tries sampling and goes straight to the nested CLI fallback (ResolveSamplingServerreturns null). I couldn't find why from outside the native runtime.2. Setting
COPILOT_CLI_PATHin the plugin's ownmcp-servers.Upgrade.envblock doesn't help either. I addedCOPILOT_CLI_PATHpointing at the SDK's cachedgithub-copilot-sdk\cli\1.0.80\copilot.exe, plusCOPILOT_CLI_BINARY_VERSION: 1.0.80, toagents/upgrade.agent.md.start_taskstill failed the same way. Outside the server, the SDK does start that binary successfully:CopilotClient.StartAsyncwithEnvironment["COPILOT_CLI_PATH"]set to the 1.0.80 exe succeeded, because--no-auto-updatekeeps the loader on 1.0.80 / protocol 3. So the host-set value seems to win over the server'senv:block as well as over the inherited shell environment.3. The agent doesn't consistently stop at the failure. In one run it reported the blocker and stopped after the plan. In another, with an identical setup, it worked around the blocker by doing the plan's tasks through ordinary sub-agents, with no task records. Users may get a "completed" upgrade without the workflow's task tracking.
+1 on surfacing the inner exception message, and on an SDK build that speaks protocol 4. If the sampling path is the intended primary route, a note on when the host advertises sampling to plugin MCP servers would also help.