Skip empty SSE data to avoid parsing errors (#1670)

This commit is contained in:
Felix Weinberger 2025-11-26 18:09:39 +00:00 • committed by GitHub
commit 5983a650cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -160,6 +160,9 @@ class StreamableHTTPTransport:
) -> bool:
"""Handle an SSE event, returning True if the response is complete."""
if sse.event == "message":
# Skip empty data (keep-alive pings)
if not sse.data:
return False
try:
message = JSONRPCMessage.model_validate_json(sse.data)
logger.debug(f"SSE message: {message}")