From 1a4bdd2b30017d901b9cac1e2e10684ec1edd062 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 22 Jan 2026 14:59:15 +0400 Subject: [PATCH] refac --- backend/open_webui/tools/builtin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index fcd1d4d23..874a073af 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -892,6 +892,7 @@ async def search_chats( end_timestamp: Optional[int] = None, __request__: Request = None, __user__: dict = None, + __chat_id__: str = None, ) -> str: """ Search the user's previous chat conversations by title and message content. @@ -921,6 +922,10 @@ async def search_chats( results = [] for chat in chats: + # Skip the current chat to avoid showing it in search results + if __chat_id__ and chat.id == __chat_id__: + continue + # Apply date filters (updated_at is in seconds) if start_timestamp and chat.updated_at < start_timestamp: continue