From 2140c189e16c42cb2b9f621985f299eac421f51e Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 31 Aug 2026 00:05:34 -0400 Subject: [PATCH] refac --- backend/open_webui/utils/tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/tools.py b/backend/open_webui/utils/tools.py index 3ababccb28..0f18d2b753 100644 --- a/backend/open_webui/utils/tools.py +++ b/backend/open_webui/utils/tools.py @@ -1368,7 +1368,10 @@ async def get_terminal_tools( - Builds callables that route through the terminal proxy """ connections = await Config.get('terminal_server.connections', []) or [] - connection = next((c for c in connections if c.get('id') == terminal_id), None) + connection = next( + (terminal_connection for terminal_connection in connections if terminal_connection.get('id') == terminal_id), + None, + ) if connection is None: raise RuntimeError(f"Terminal server '{terminal_id}' not found") if not connection.get('enabled', True):