@@ -170,20 +170,20 @@ async def _handle_sse_event(
170170
171171 # If this is a response and we have original_request_id, replace it
172172 if original_request_id is not None and isinstance (message .root , JSONRPCResponse | JSONRPCError ):
173- message .root .id = original_request_id
173+ message .root .id = original_request_id # pragma: no cover
174174
175175 session_message = SessionMessage (message )
176- await read_stream_writer .send (session_message )
176+ await read_stream_writer .send (session_message ) # pragma: no cover
177177
178178 # Call resumption token callback if we have an ID. Only update
179179 # the resumption token on notifications to avoid overwriting it
180180 # with the token from the final response.
181181 if sse .id and resumption_callback and not isinstance (message .root , JSONRPCResponse | JSONRPCError ):
182- await resumption_callback (sse .id .strip ())
182+ await resumption_callback (sse .id .strip ()) # pragma: no cover
183183
184184 # If this is a response or error return True indicating completion
185185 # Otherwise, return False to continue listening
186- return isinstance (message .root , JSONRPCResponse | JSONRPCError )
186+ return isinstance (message .root , JSONRPCResponse | JSONRPCError ) # pragma: no cover
187187
188188 except Exception as exc : # pragma: no cover
189189 logger .exception ("Error parsing SSE message" )
@@ -221,7 +221,7 @@ async def handle_get_stream(
221221 except Exception as exc :
222222 logger .debug (f"GET stream error (non-fatal): { exc } " ) # pragma: no cover
223223
224- async def _handle_resumption_request (self , ctx : RequestContext ) -> None :
224+ async def _handle_resumption_request (self , ctx : RequestContext ) -> None : # pragma: no cover
225225 """Handle a resumption request using GET with SSE."""
226226 headers = self ._prepare_request_headers (ctx .headers )
227227 if ctx .metadata and ctx .metadata .resumption_token :
@@ -339,7 +339,7 @@ async def _handle_sse_response(
339339 if is_complete :
340340 await response .aclose ()
341341 break
342- except Exception as e :
342+ except Exception as e : # pragma: no cover
343343 logger .exception ("Error reading SSE stream:" ) # pragma: no cover
344344 await ctx .read_stream_writer .send (e ) # pragma: no cover
345345
@@ -408,7 +408,7 @@ async def post_writer(
408408
409409 async def handle_request_async ():
410410 if is_resumption :
411- await self ._handle_resumption_request (ctx )
411+ await self ._handle_resumption_request (ctx ) # pragma: no cover
412412 else :
413413 await self ._handle_post_request (ctx )
414414
0 commit comments