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
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-12 21:42:21 +09:00
1 parent c557cf58aa
commit 3d36b436c6
1 file changed
+1
+1
View File
@@ -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