We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 103e201 commit 49fa6c2Copy full SHA for 49fa6c2
src/mcp/client/streamable_http.py
@@ -161,8 +161,14 @@ async def _handle_sse_event(
161
session_message = SessionMessage(message)
162
await read_stream_writer.send(session_message)
163
164
- # Call resumption token callback if we have an ID
165
- if sse.id and resumption_callback:
+ # Call resumption token callback if we have an ID. Only update
+ # the resumption token on notifications to avoid overwriting it
166
+ # with the token from the final response.
167
+ if (
168
+ sse.id
169
+ and resumption_callback
170
+ and not isinstance(message.root, JSONRPCResponse | JSONRPCError)
171
+ ):
172
await resumption_callback(sse.id)
173
174
# If this is a response or error return True indicating completion
0 commit comments