From fccd75568478a38d580f301b91b0a0eb7bd02cd4 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 24 Sep 2026 21:58:50 +0200 Subject: [PATCH] fix: send the saved title in the chat:title event when title generation is off (#31355) Fixes #31348 With title generation turned off (per user or by the admin), the chat is saved with the first user message as its title, but the live title event sent the assistant message instead. A new chat therefore kept showing "New Chat" in the header and tab until a reload, because the assistant message is still empty at that point. In a note's chat panel the whole model reply showed up as the title. The fallback branch now sends the title it just saved, the same way the generated-title branch above it already does. The sidebar was never affected because it reloads titles from the database. --- backend/open_webui/utils/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index de2b3c49fc..754b90c0c0 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -3979,7 +3979,7 @@ async def background_tasks_handler(ctx): await event_emitter( { 'type': 'chat:title', - 'data': message.get('content', user_message), + 'data': title, } )