mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-05 18:38:17 -05:00
[PR #21480] [CLOSED] fix: images send to models #49145
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21480
Author: @Classic298
Created: 2/16/2026
Status: ❌ Closed
Base:
dev← Head:fix-image-input📝 Commits (1)
687c06efix: preserve image data when loading messages from DB (#155)📊 Changes
1 file changed (+35 additions, -4 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+35 -4)📄 Description
The load_messages_from_db function replaces frontend-constructed messages with DB messages for tool call handling, but only keeps role/content/output fields, dropping the files array.
The frontend builds image_url content parts from message.files at request time. Since the DB stores content as plain text (not multipart arrays with image_url items), replacing messages causes all image data to be silently lost. Vision-capable models then receive no images.
Fix: reconstruct image_url content parts from the message's files array when loading from DB, matching the frontend's behavior.
Fixes #21477, #21457
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.