From b854eb09b13216f914ce5fd07ab717b8f752882b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 29 Jun 2026 00:46:45 -0500 Subject: [PATCH] refac --- backend/open_webui/tools/builtin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index 0ce3c75004..06f34dd890 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -1155,7 +1155,7 @@ async def search_chats( # Find a matching message snippet snippet = '' - messages = chat.chat.get('history', {}).get('messages', {}) + messages = (getattr(chat, 'chat', None) or {}).get('history', {}).get('messages', {}) lower_query = query.lower() for msg_id, msg in messages.items():