OpenWebUI stores pasted/uploaded chat images under message files, but the outgoing OpenAI-compatible payload may only include text content when those files are not lifted into messages[].content parts. This causes downstream gateways/providers to miss image inputs even though the UI shows an attachment.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21503
Author: @Plutarch01
Created: 2/17/2026
Status: ❌ Closed
Base:
main← Head:fix/chat-files-image-forwarding📝 Commits (1)
4f1237afix: forward chat attachment images in OpenAI payload📊 Changes
3 files changed (+232 additions, -0 deletions)
View changed files
➕
backend/open_webui/test/util/test_middleware_images.py(+124 -0)➕
backend/open_webui/utils/chat_image_payload.py(+95 -0)📝
backend/open_webui/utils/middleware.py(+13 -0)📄 Description
Summary
append_chat_file_images_to_user_messagesto convert DB-backed chatfilesimage attachments into OpenAIimage_urlmessage partsprocess_chat_payloadafter URL->base64 normalization so image attachments survive OpenAI-compatible forwardingimage_urlparts and ignoring non-image attachmentsWhy
OpenWebUI stores pasted/uploaded chat images under message
files, but the outgoing OpenAI-compatible payload may only include text content when those files are not lifted intomessages[].contentparts. This causes downstream gateways/providers to miss image inputs even though the UI shows an attachment.Testing
python -m py_compile backend/open_webui/utils/middleware.py backend/open_webui/utils/chat_image_payload.py backend/open_webui/test/util/test_middleware_images.pypython -c \"import sys,pytest; sys.path.insert(0,'backend'); raise SystemExit(pytest.main(['backend/open_webui/test/util/test_middleware_images.py']))\"🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.