mirror of
https://github.com/open-webui/computer.git
synced 2026-11-05 01:17:24 +00:00
[GH-ISSUE #194] bug: multimodal content (image attachment) 500s /v1/chat/completions — list bound to a TEXT column #114
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/computer#114
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Originally created by @penradioGables on GitHub (Jul 28, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/194
Summary
Attaching or pasting an image into an Open WebUI chat backed by a cptr workspace model makes
POST /v1/chat/completionsfail before the agentic loop starts. The reply never arrives and the UI shows no error — the chat just sits there.Verified still present in v0.9.15.
cptr/routers/gateway.pyis byte-identical between thev0.9.10andv0.9.15tags, so the line numbers below apply to currentmain.This is the same underlying assumption as #78 (closed), in a different place. That issue's report closed with "Worth auditing other spots in the message path that assume
contentis astr" — this is one of those spots, and it is still live.Root cause
OWUI, like any OpenAI-compatible client, sends
contentas a plain string for text-only turns but as a list of typed parts as soon as an image is attached:gateway.py::_resolve_messagestakes that value raw (L277–284):and passes it straight into
ChatMessage.create(content=user_content)(L321–327).ChatMessage.contentisColumn(Text, nullable=False), so binding a list raises:The exception escapes the endpoint before anything is streamed, which is why the client sees no error at all.
_ensure_chatcarries the same assumption independently (L702–708) — it slices the content to build a title, which on a list yields a list, then calls.strip()on it:That path only fires when the first message of a brand-new chat carries the image, which is why the failure usually presents as the sqlite error rather than an
AttributeError.Reproduction
Any Open WebUI chat against a cptr workspace model, with one pasted image. Reproduced on 0.9.10 against a running instance (SQLite backend); the crashing code is unchanged in v0.9.15.
Suggested fix
The codebase already has the right helper —
cptr/utils/agents/prompts.py::message_text()flattens exactly this shape and is used by the agent adapters.gateway.pysimply never imports it. Using it in both places above fixes the crash.Worth noting separately: even once the crash is fixed, images are still discarded on this path. cptr's own
prepare_agent_attachments()reads images fromChatMessage.meta["files"], so the gateway would need to decode inlinedata:URIs into storage and populate that key for attachments to actually reach the agent rather than merely not crash.Happy to open a PR if useful.
@owui-terminator[bot] commented on GitHub (Jul 28, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟣 #78 TypeError: expected string or bytes-like object, got 'list' when sending a message with an image attachment
This is the closest prior report of the same underlying bug class: multimodal message content arriving as a list instead of a string and crashing a cptr message-path handler. The new issue simply identifies a different code location (
gateway.py) that makes the same assumption.by chhotu-claw
🟣 #153 bug: chat_messages INSERT crashes when Open WebUI
modelsarray reaches the scalarmodelcolumn — message rows silently droppedDirectly related because it is another chat persistence crash caused by binding a Python list into a scalar TEXT column during
chat_messagesINSERT. The new issue’s sqlite error is the same failure mode, just triggered by image-bearingcontentrather thanmodel.by penradioGables
🟣 #50 Gateway connection hangs in OpenWebUI
Related at the symptom level because both describe OpenWebUI-to-cptr
/v1/chat/completionsrequests that hang or never complete, indicating gateway-side failures in the same request path. However, this one appears broader and not specifically tied to multimodal attachments.by naqerl
💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@tjbck commented on GitHub (Jul 31, 2026):
Addressed!