Skip to content

Conversation

@findleyr
Copy link
Contributor

Do a pass through the streamable client reconnection logic, and fix several bugs.

  • Establish the initial GET even if MaxRetries is 0 (MaxRetries = 0 actually never attempts a connection #256). This was broken because the GET bypasses the initial request and going straight to the SSE GET reconnection logic.
  • Release the stream ownership when POST requests exit.
  • Don't reconnect POST requests if we've received the expected response.
  • Move unexported reconnection config to constants. Otherwise it is too hard to set ReconnectOptions (you have to use the DefaultOptions and mutate).

Fixes #256

Do a pass through the streamable client reconnection logic, and fix
several bugs.

- Establish the initial GET even if MaxRetries is 0 (modelcontextprotocol#256). This was
  broken because the GET bypasses the initial request and going straight
  to the SSE GET reconnection logic.
- Release the stream ownership when POST requests exit.
- Don't reconnect POST requests if we've received the expected response.
- Move unexported reconnection config to constants. Otherwise it is too
  hard to set ReconnectOptions (you have to use the DefaultOptions and
  mutate).

Fixes modelcontextprotocol#256
@findleyr findleyr requested review from jba and samthanawalla August 15, 2025 20:28
@findleyr findleyr merged commit 1afdb1f into modelcontextprotocol:main Aug 15, 2025
5 checks passed
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.

MaxRetries = 0 actually never attempts a connection

2 participants