Skip to content

Conversation

@majiayu000
Copy link

Fixes #679

Changes

  • Track last event ID to detect progress in SSE streams
  • Only reset retry counter when Last-Event-ID advances
  • Fail connection after exceeding maxRetries without progress

This implements Option 2 from the issue: progress-based retry limiting that prevents infinite retry loops while allowing long-running streams to continue as long as progress is made.

…extprotocol#679)

Previously, the StreamableClientTransport retry counter would reset
whenever a connection was re-established, which could lead to infinite
retry loops if a server continuously terminates connections without
making progress (advancing the Last-Event-ID).

This change tracks progress across retry attempts in handleSSE:
- The retry counter is only reset when the Last-Event-ID advances
- If maxRetries is exceeded without progress, the connection fails
- This implements Option 2 from the issue discussion

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
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.

Set a total retry limit on streams, or enforce progress

1 participant