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
This commit is contained in:
Classic298 authored and GitHub committed 2026-10-08 16:54:32 +04:00
1 parent 8f11fda874
commit 6e2ef55e52
1 file changed
+2 -1
+2 -1
View File
@@ -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},
}
)