From c488f60e8bb3f1c2d4bf2a8220114d1820ba6602 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 30 Sep 2026 17:05:21 +0200 Subject: [PATCH] fix: temporary chats save sub-agent conversations on the server (#31573) In a temporary chat, when the model handed a task to a sub-agent, the sub-agent's conversation with the task and its answer was saved on the server, although a temporary chat should leave nothing behind. The model is no longer offered sub-agents in temporary chats. Fixes #31567 --- backend/open_webui/utils/tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/tools.py b/backend/open_webui/utils/tools.py index 7bd6a8dd69..120bbb39b4 100644 --- a/backend/open_webui/utils/tools.py +++ b/backend/open_webui/utils/tools.py @@ -101,7 +101,7 @@ from open_webui.tools.builtin import ( write_note, ) from open_webui.utils.access_control import has_access, has_connection_access, has_permission -from open_webui.utils.chat_id import is_saved_chat_id +from open_webui.utils.chat_id import is_saved_chat_id, is_temporary_chat_id from open_webui.utils.headers import ( bearer_auth_header, get_custom_headers, @@ -650,6 +650,7 @@ async def get_builtin_tools( and config.get('subagents.enable') and getattr(request.state, 'internal', False) is not True and getattr(request.state, 'direct', False) is not True + and not is_temporary_chat_id(metadata.get('chat_id')) ): builtin_functions.extend([delegate_task, timer])