Skip to content

fix(connect): match VS Code agent host and Insiders client names - #1961

Merged
Dumbris merged 5 commits into
smart-mcp-proxy:mainfrom
felipecrs:claude/vscode-agent-host-issue-1ecbe0
Nov 24, 2026
Merged

Dumbris merged 5 commits into
smart-mcp-proxy:mainfrom
felipecrs:claude/vscode-agent-host-issue-1ecbe0

Conversation

@felipecrs

@felipecrs felipecrs commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Description

Fixes #1959. Presence matches the MCP initialize request's clientInfo.name exactly against ClientInfoNames. VS Code 1.147 sends a name that no client lists, so the Copilot row stays connected_never_seen and an "other" row appears.

What each VS Code path sends. VS Code links are pinned to the 1.147.0 tag.

VS Code path When it's used clientInfo.name Matched by Change
Agent host Default when the agent host is on (source) vscode-agent-host, set as clientName copilot Added
Local harness, stable Fallback when the agent host is off (source) productService.nameLong = Visual Studio Code vscode None, already listed
Local harness, Insiders Same nameLong = Visual Studio Code - Insiders (VS Code checks both names on appName = nameLong) vscode Added
Copilot extension's Copilot CLI sessions Picked as a session type SDK clientName: 'vscode' n/a None: MCP servers come through VS Code's MCP gateway, not from ~/.copilot/mcp-config.json
Copilot CLI (standalone, not VS Code) n/a github-copilot-developer copilot None, already listed

Caveat. The Copilot SDK documents clientName only as part of the User-Agent. The MCP clientInfo.name is set by the Copilot CLI runtime, which isn't open source, so the link from clientName to clientInfo.name comes from what #1959 observed, not from source.

Not in this PR: the issue's second option, matching a session to a client by the credential it uses whatever name it sends.

Testing

  • I have tested these changes locally
  • I have added/updated tests that prove my fix is effective or my feature works
  • All existing tests pass

TestCopilotClientInfoNamesMatchWhatCopilotSends now also checks vscode-agent-host. go test passes for internal/connect, internal/clientidentity, and the client/presence/connect tests in internal/httpapi, internal/runtime and internal/server, using the CI skip list for the E2E tests that start the binary. Not checked against a live VS Code. golangci-lint was not run.

VS Code 1.147's Copilot agent host initializes with clientInfo.name
"vscode-agent-host", and its Copilot CLI sessions with the agent host off
send "vscode". Both read ~/.copilot/mcp-config.json, so they belong to the
copilot client. The copilot row stayed connected_never_seen and the sessions
showed up as an "other" row (or, for "vscode", under the VS Code client).

Move "vscode" from the VS Code client to copilot and add
"vscode-agent-host". The VS Code Local harness sends the product's long
name, so the VS Code client also gains "Visual Studio Code - Insiders".

Fixes smart-mcp-proxy#1959
The clientName 'vscode' Copilot CLI sessions get their MCP servers through
VS Code's MCP gateway, so nothing shows that name reaching MCPProxy with the
Copilot credential. With the agent host off, VS Code falls back to the Local
harness, which the VS Code client already matches.
@felipecrs felipecrs changed the title fix(connect): match the clientInfo names VS Code's Copilot paths send fix(connect): match VS Code agent host and Insiders client names Nov 20, 2026
felipecrs added a commit to felipecrs/mcpproxy-go that referenced this pull request Nov 20, 2026
felipecrs added a commit to felipecrs/mcpproxy-go that referenced this pull request Nov 21, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…into claude/vscode-agent-host-issue-1ecbe0
felipecrs added a commit to felipecrs/mcpproxy-go that referenced this pull request Nov 23, 2026
@Dumbris
Dumbris enabled auto-merge (squash) November 24, 2026 11:24
@Dumbris

Dumbris commented Nov 24, 2026

Copy link
Copy Markdown
Member

Thanks @felipecrs — this is a clean, well-sourced fix, and the table of what each VS Code path sends made it easy to verify. I checked the 1.147.0 tag myself: AGENT_HOST_COPILOT_CLIENT_NAME = 'vscode-agent-host' and clientInfo.name = productService.nameLong both match what you list, and the Insiders nameLong string is the one loopbackServer.ts already special-cases. Matching in mcpproxy is trimmed + case-insensitive exact (clientidentity.NormalizeRaw), and neither new alias collides with another registry entry. go test for internal/connect, clientidentity, httpapi, runtime passes on your branch.

Two small, non-blocking notes:

  1. The new test only asserts vscode-agent-host is in the Copilot list (and doesn't pin the Insiders alias). If you want to tighten it, add "Visual Studio Code - Insiders" to a check on the vscode client, and assert each alias is in exactly one client's ClientInfoNames.
  2. Visual Studio Code - Insiders will now light up the VS Code row, but Connect's config path for vscode still targets the stable Code/User/mcp.json, not Code - Insiders/User/mcp.json. That's an existing limitation and fine to leave for a follow-up; just flagging it.

CI is approved and running; this is set to merge once it is green.

@Dumbris
Dumbris merged commit ad5d12c into smart-mcp-proxy:main Nov 24, 2026
49 checks passed
@Dumbris

Dumbris commented Nov 24, 2026

Copy link
Copy Markdown
Member

Merged — thanks @felipecrs. The table of what each VS Code path sends made this quick to verify, and it fixes #1959 for both the agent host and Insiders. It ships in the next release.

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.

[Bug]: Does not detect VS Code connection

3 participants