Skip to content

Fix cache-sensitive HTTP MCP definition equality - #329857

Closed
Akarsh (akarshm) wants to merge 5 commits into
microsoft:mainfrom
akarshm:fix/mcp-uri-cache-equality
Closed

Akarsh (akarshm) wants to merge 5 commits into
microsoft:mainfrom
akarshm:fix/mcp-uri-cache-equality

Conversation

@akarshm

Copy link
Copy Markdown

Summary

  • prevent equivalent HTTP MCP definitions from being treated as changed when URI lazy-cache state differs
  • normalize HTTP launch identity consistently across equality, serialization, revival, and hashing
  • preserve stdio launch behavior and unknown HTTP properties

Testing

  • 30 focused mcpTypes tests
  • targeted TypeScript analysis with no implementation or non-ambient test diagnostics
  • git diff --check

Fixes #327970

Copilot AI balanced review requested due to automatic review settings August 9, 2026 21:14

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.

Pull request overview

Fixes MCP server restart loops caused by URI lazy-cache state affecting HTTP definition identity.

Changes:

  • Canonicalizes HTTP launches for equality, serialization, revival, and hashing.
  • Preserves stdio behavior and unknown HTTP properties.
  • Adds focused tests for cache state, round trips, hashing, and edge cases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/workbench/contrib/mcp/common/mcpTypes.ts Implements canonical MCP HTTP launch identity.
src/vs/workbench/contrib/mcp/test/common/mcpTypes.test.ts Adds regression and edge-case coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dmitrivMS

Copy link
Copy Markdown
Collaborator

The linked issue has already been fixed.

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.

MCP servers are stopped immediately after tool discovery (and mid-initialize) since 1.129 - kills stateful servers (1.128 OK, 1.130/1.131 broken)

4 participants