@@ -30,7 +30,6 @@ class SseCommunicationProtocol(CommunicationProtocol):
3030
3131 def __init__ (self , logger : Optional [Callable [[str ], None ]] = None ):
3232 self ._oauth_tokens : Dict [str , Dict [str , Any ]] = {}
33- self ._active_connections : Dict [str , tuple [aiohttp .ClientResponse , aiohttp .ClientSession ]] = {}
3433
3534 def _apply_auth (self , provider : SseCallTemplate , headers : Dict [str , str ], query_params : Dict [str , Any ]) -> tuple :
3635 """Apply authentication to the request based on the provider's auth configuration.
@@ -148,13 +147,9 @@ async def register_manual(self, caller, manual_call_template: CallTemplate) -> R
148147
149148 async def deregister_manual (self , caller , manual_call_template : CallTemplate ) -> None :
150149 """REQUIRED
151- Deregister an SSE manual and close any active connections."""
152- template_name = manual_call_template .name
153- if template_name in self ._active_connections :
154- response , session = self ._active_connections .pop (template_name )
155- response .close ()
156- await session .close ()
157-
150+ Deregister an SSE manual."""
151+ pass
152+
158153 async def call_tool (self , caller , tool_name : str , tool_args : Dict [str , Any ], tool_call_template : CallTemplate ) -> Any :
159154 """REQUIRED
160155 Execute a tool call through SSE transport."""
@@ -210,7 +205,6 @@ async def call_tool_streaming(self, caller, tool_name: str, tool_args: Dict[str,
210205 auth = auth , cookies = cookies , json = json_data , data = data , timeout = None
211206 )
212207 response .raise_for_status ()
213- self ._active_connections [tool_call_template .name ] = (response , session )
214208 async for event in self ._process_sse_stream (response , tool_call_template .event_type ):
215209 yield event
216210 except Exception as e :
@@ -300,15 +294,6 @@ async def _handle_oauth2(self, auth_details: OAuth2Auth) -> str:
300294 except aiohttp .ClientError as e :
301295 logger .error (f"OAuth2 with header failed: { e } " )
302296 raise e
303-
304- async def close (self ):
305- """Closes all active connections and sessions."""
306- for provider_name in list (self ._active_connections .keys ()):
307- if provider_name in self ._active_connections :
308- response , session = self ._active_connections .pop (provider_name )
309- response .close ()
310- await session .close ()
311- self ._active_connections .clear ()
312297
313298 def _build_url_with_path_params (self , url_template : str , tool_args : Dict [str , Any ]) -> str :
314299 """Build URL by substituting path parameters from arguments.
0 commit comments