@@ -183,9 +183,7 @@ async def _start_agent(self) -> AsyncGenerator[Self]:
183183 "internal error: _impl was not set to None after agent invocation"
184184 )
185185
186- splunk_username = await asyncio .to_thread (
187- lambda : _get_splunk_username (self ._service )
188- )
186+ splunk_username = await asyncio .to_thread (lambda : _get_splunk_username (self ._service ))
189187 _validate_agent_privileges (splunk_username )
190188
191189 self .logger .debug (f"Creating agent { self .name = } ; { self .trace_id = } " )
@@ -201,9 +199,7 @@ async def _start_agent(self) -> AsyncGenerator[Self]:
201199
202200 self ._impl = None
203201
204- async def _load_tools (
205- self , stack : AsyncExitStack , splunk_username : str
206- ) -> list [Tool ]:
202+ async def _load_tools (self , stack : AsyncExitStack , splunk_username : str ) -> list [Tool ]:
207203 tools : list [Tool ] = []
208204 if not self .tool_settings .local and not self .tool_settings .remote :
209205 return tools
@@ -234,9 +230,7 @@ async def _load_tools(
234230 if self .tool_settings .remote :
235231 self .logger .debug ("Probing MCP Server App availability" )
236232 remote_session = await stack .enter_async_context (
237- connect_remote_mcp (
238- self ._service , app_id , self .trace_id , splunk_username
239- )
233+ connect_remote_mcp (self ._service , app_id , self .trace_id , splunk_username )
240234 )
241235
242236 if remote_session :
@@ -252,9 +246,7 @@ async def _load_tools(
252246 allowlist = self .tool_settings .remote .allowlist
253247 remote_tools = [rt for rt in remote_tools if allowlist .is_allowed (rt )]
254248
255- self .logger .debug (
256- f"Loaded remote_tools={ [t .name for t in remote_tools ]} "
257- )
249+ self .logger .debug (f"Loaded remote_tools={ [t .name for t in remote_tools ]} " )
258250 tools .extend (remote_tools )
259251
260252 return tools
@@ -265,13 +257,9 @@ async def __aenter__(self) -> Self:
265257 self ._agent_context_manager = self ._start_agent ()
266258 return await self ._agent_context_manager .__aenter__ ()
267259
268- async def __aexit__ (
269- self , exc_type : ..., exc_value : ..., traceback : ...
270- ) -> bool | None :
260+ async def __aexit__ (self , exc_type : ..., exc_value : ..., traceback : ...) -> bool | None :
271261 assert self ._agent_context_manager is not None
272- result = await self ._agent_context_manager .__aexit__ (
273- exc_type , exc_value , traceback
274- )
262+ result = await self ._agent_context_manager .__aexit__ (exc_type , exc_value , traceback )
275263 self ._agent_context_manager = None
276264 return result
277265
@@ -324,9 +312,7 @@ def _local_tools_path() -> tuple[str | None, str]:
324312 app_id , app_dir = locate_app ()
325313 local_tools_path = build_local_tools_path (app_dir )
326314
327- assert app_id is not None , (
328- "_load_tools_from_mcp was mocked, but _testing_app_id not"
329- )
315+ assert app_id is not None , "_load_tools_from_mcp was mocked, but _testing_app_id not"
330316
331317 if not os .path .exists (local_tools_path ):
332318 local_tools_path = None
0 commit comments