From 6e2ef55e522749dd885d7296f2ff7bbc6361e6b5 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 8 Oct 2026 14:54:32 +0200 Subject: [PATCH] fix: images streamed by the model are saved several times (#32054) When a model streams its images in separate chunks, each new chunk saved all earlier images again, so the copies doubled with every image: four images were stored as fifteen and the chat showed duplicates. New replies now keep each image once. Chats that already hold duplicates stay as they are. Fixes #32053 --- backend/open_webui/utils/middleware.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 75c6355b07..bf4e5d5606 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -5392,9 +5392,10 @@ async def streaming_chat_response_handler(response, ctx): if message_files is None: message_files = image_file_list + # 'files' would make the emitter save these again. await event_emitter( { - 'type': 'files', + 'type': 'chat:message:files', 'data': {'files': message_files}, } )