Skip to content

Fix duplicated 'http.response.start' event error during client session disconnection #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cuspymd
Copy link

@cuspymd cuspymd commented Jul 18, 2025

Describe your changes

When a client session is disconnected, the handle_mcp_connection() function returns None, which the server processes as a JsonResponse, triggering the 'http.response.start' event. To prevent the 'http.response.start' event from occurring, it was modified to return a VoidResponse that does not generate any message.

For reference, this error always occurs when the SSE client session is disconnected, regardless of middleware registration.

Issue ticket number and link (if applicable)

#171

Screenshots of the feature / bugfix

Checklist before requesting a review

  • Added relevant tests
  • Run ruff & mypy
  • All tests pass

@CaddyGlow
Copy link

I can confirm that it's also fixing the #171 for me

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