From 3d36b436c6609a7d020b08bd9f45d2aac73dc863 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 12 Nov 2026 13:42:21 +0100 Subject: [PATCH] fix: chat reopens on an older turn after an out-of-date window saves an edit (#34160) A window that had missed a turn, for example a laptop that just woke up and has not reconnected yet, saved its own, older idea of where the chat was when it saved an edited message. The chat then reopened on that older turn, and the next message started a new branch there, so the newest reply moved behind the branch switch and the model no longer saw it. A save now keeps the chat on the newest turn of the branch it is on, the same turn the chat already shows once it has caught up. Fixes #34126 --- backend/open_webui/models/chats.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/open_webui/models/chats.py b/backend/open_webui/models/chats.py index 3fad7867d2..49301a76e7 100644 --- a/backend/open_webui/models/chats.py +++ b/backend/open_webui/models/chats.py @@ -883,6 +883,7 @@ class ChatTable: ): updated['history']['messages'][mid] = message updated['history'] = self.merge_history(updated['history'], {}) + self._repair_chat_current_id(updated) updated = self._clean_null_bytes(updated) chat_item.chat = updated