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 2026-10-08 14:54:32 +02:00 • committed by GitHub
parent 8f11fda874
commit 6e2ef55e52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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},
}
)