From 460f2e76349c0aee730f710252f799eb1d6a9bf0 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 17 Sep 2026 23:39:43 +0200 Subject: [PATCH] fix: surface initial chat title generation failures in the log (#30106) When title generation for a brand new chat fails, the chat silently keeps the provisional title (the full first user message) and nothing is written to the log at the default level, so there is no way to tell that the feature is broken rather than disabled. The failure was caught by a broad `except Exception` and reported with `log.debug`, which is invisible unless GLOBAL_LOG_LEVEL is set to DEBUG. Issue #29533 describes an outage of this path that survived four releases for exactly that reason. This logs it with `log.exception` instead, matching how the rest of main.py reports background task failures, so an admin sees one ERROR line plus the traceback naming the real cause. Nothing else changes: the success path is untouched, the exception is still swallowed so the detached task cannot take anything down with it, and `background_tasks_handler` does not log this exception itself, so there is no duplicate traceback. Fixes #29533 --- backend/open_webui/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 5ce9aa542c..9324aca51c 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1464,8 +1464,8 @@ async def chat_completion( async def run_initial_title_generation(): try: await background_tasks_handler(title_ctx) - except Exception as e: - log.debug('Error generating initial chat title: %s', e) + except Exception: + log.exception('Error generating initial chat title') asyncio.create_task(run_initial_title_generation()) else: