You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix infinite reconnection loop in StreamableHTTP client
_handle_reconnection() reset the attempt counter to 0 when the SSE
stream ended without delivering a complete response (only priming
events). This made MAX_RECONNECTION_ATTEMPTS ineffective—a server
that accepts connections but drops streams caused the client to retry
forever.
The fix distinguishes productive reconnections (ones that delivered
actual message data like notifications) from unproductive ones (only
priming events or nothing). Productive reconnections reset the counter
so legitimate multi-close patterns continue working. Unproductive
reconnections increment the counter, and once MAX_RECONNECTION_ATTEMPTS
is reached the client sends an error back to the caller instead of
silently returning (which caused the caller to hang).
Made-with: Cursor
Github-Issue: #2393
Made-with: Cursor
0 commit comments