Skip to content

Conversation

connor4312
Copy link
Member

Fixes #263068

@Copilot Copilot AI review requested due to automatic review settings October 8, 2025 20:57
@connor4312 connor4312 enabled auto-merge (squash) October 8, 2025 20:57
@connor4312 connor4312 self-assigned this Oct 8, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements proper close transport message handling for streamable HTTP connections in the MCP (Model Context Protocol) service. The changes ensure that HTTP sessions are properly terminated when connections are stopped.

  • Adds session cleanup logic with proper HTTP DELETE requests for active sessions
  • Implements graceful connection state management with close tracking
  • Refactors the stop logic to handle both immediate and deferred cleanup scenarios

this._launch.uri.toString(true),
{
method: 'DELETE',
headers: { 'Mcp-Session-Id': sessionId },
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The headers object is constructed with session ID on line 274, then auth headers are added on line 277, but the fetch call on line 284 only uses a new headers object with just the session ID, ignoring the auth headers that were added.

Suggested change
headers: { 'Mcp-Session-Id': sessionId },
headers,

Copilot uses AI. Check for mistakes.

@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 8, 2025
hediet
hediet previously approved these changes Oct 8, 2025
@connor4312 connor4312 force-pushed the connor4312/issue263068 branch from 6c83729 to aefc123 Compare October 8, 2025 21:25
@connor4312 connor4312 closed this Oct 8, 2025
auto-merge was automatically disabled October 8, 2025 21:39

Pull request was closed

@connor4312 connor4312 reopened this Oct 8, 2025
@connor4312 connor4312 enabled auto-merge (squash) October 8, 2025 21:40
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 Close transport message
3 participants