Skip to content

fix(connect): match the clientInfo names VS Code's Copilot paths send - #1

Closed
felipecrs wants to merge 1 commit into
mainfrom
claude/vscode-agent-host-issue-1ecbe0
Closed

felipecrs wants to merge 1 commit into
mainfrom
claude/vscode-agent-host-issue-1ecbe0

Conversation

@felipecrs

Copy link
Copy Markdown
Owner

Pull Request

Description

Fixes smart-mcp-proxy#1959. Connect for GitHub Copilot works, but the Copilot row stays connected_never_seen because VS Code reports a clientInfo.name that the copilot client doesn't list.

Presence matches clientInfo.name exactly against ClientInfoNames. Here is what each VS Code path sends, from VS Code's source:

VS Code path clientInfo.name Config it reads Before After
Agent host (default in 1.147), copilotSessionLauncher.ts vscode-agent-host ~/.copilot/mcp-config.json "other" row copilot
Copilot CLI sessions with the agent host off, copilotcliSessionService.ts (clientName: 'vscode') vscode ~/.copilot/mcp-config.json VS Code client (wrong) copilot
Local harness, mcpServerRequestHandler.ts (productService.nameLong) Visual Studio Code Code/User/mcp.json vscode vscode
Same, on Insiders Visual Studio Code - Insiders Code/User/mcp.json "other" row vscode

Changes, all in internal/connect/clients.go:

  • copilot: add vscode-agent-host and vscode.
  • vscode: add Visual Studio Code - Insiders, and drop vscode, because the Local harness never sends it.

Notes for reviewers:

  • The vscode → copilot mapping is inferred. The agent-host case shows the Copilot SDK sends its host's clientName as clientInfo.name, and I'm assuming the clientName: 'vscode' path works the same way. Not checked against a live VS Code with the agent host off.
  • The issue's second option, counting a session as a supported client when it uses that client's credential whatever name it sends, isn't done here. Unrecognised names would still create their own "other" row, so that needs a bigger change.

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

TestClientInfoNamesMatchWhatEachHostSends replaces the copilot-only alias test and covers both clients. 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. 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
@felipecrs

Copy link
Copy Markdown
Owner Author

Moved upstream: smart-mcp-proxy#1961

@felipecrs felipecrs closed this Nov 20, 2026
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

1 participant