Skip to content

fix: clean up session when disconnected#2044

Closed
nightosong wants to merge 2 commits intomodelcontextprotocol:mainfrom
nightosong:fix/sse
Closed

fix: clean up session when disconnected#2044
nightosong wants to merge 2 commits intomodelcontextprotocol:mainfrom
nightosong:fix/sse

Conversation

@nightosong
Copy link

Motivation and Context

Changes:

  • Remove session_id from _read_stream_writers when the SSE connection is closed.
  • Ensure proper cleanup after EventSourceResponse returns.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@maxisbey
Copy link
Contributor

maxisbey commented Mar 4, 2026

Closing in favour of #2200 which has the same fix plus a regression test. Thanks for the contribution @nightosong — the diagnosis was correct.

AI Disclaimer

@maxisbey maxisbey closed this Mar 4, 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.

2 participants