From fa66b0f306616664fa33f4f0ffa6c2f67769a06c Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 30 Sep 2026 17:03:01 +0200 Subject: [PATCH] fix: background sub-agent and timer replies only show in the open chat after a page reload (#31576) When a sub-agent running in the background finished, or a timer the model set went off, the result and the model's follow-up reply were saved but did not show in the chat the user had open. They only appeared after a manual page reload. They now show in the open chat as soon as they arrive. Fixes #31566 --- backend/open_webui/utils/subagents.py | 1 + backend/open_webui/utils/timers.py | 1 + 2 files changed, 2 insertions(+) diff --git a/backend/open_webui/utils/subagents.py b/backend/open_webui/utils/subagents.py index 13b9699216..f020e0cd94 100644 --- a/backend/open_webui/utils/subagents.py +++ b/backend/open_webui/utils/subagents.py @@ -219,6 +219,7 @@ async def process_pending_internal_messages( history['messages'] = messages history['currentId'] = assistant_message_id chat.chat = {**(chat.chat or {}), 'history': history} + chat.current_message_id = assistant_message_id chat.updated_at = int(time.time()) await db.commit() diff --git a/backend/open_webui/utils/timers.py b/backend/open_webui/utils/timers.py index 15a6b898db..c2a91139ef 100644 --- a/backend/open_webui/utils/timers.py +++ b/backend/open_webui/utils/timers.py @@ -351,6 +351,7 @@ async def execute_due_timer(app, timer_id: str, claim_id: str | None = None) -> parent.chat = parent_chat history['currentId'] = assistant_message_id + parent.current_message_id = assistant_message_id parent.updated_at = int(time.time()) timer_row = await db.get(Chat, timer_id) if timer_row: