mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 07:46:16 -05:00
[GH-ISSUE #24157] issue: Chat stuck in infinite Loading when history.currentId points to a malformed provider response object after safety rejection #58880
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?
Originally created by @mcxiaochenn on GitHub (Apr 26, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24157
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.9.2
Ollama Version (if applicable)
No response
Operating System
Debian 12
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
A malformed or non-standard provider response should not permanently break an OpenWebUI chat.
If an upstream OpenAI-compatible provider returns a safety rejection, content filter response, or unsupported response shape, OpenWebUI should either:
chat.history.currentId.history.currentIdpoints to an invalid object.At minimum, OpenWebUI should validate that the current message has a valid message schema before rendering it, including fields such as:
A single malformed provider response should not make the entire chat unusable.
Actual Behavior
One chat became permanently stuck on the Loading screen.
The backend endpoint still returned HTTP 200:
The response body contained the chat data, but the frontend could not render the chat.
The browser console repeatedly showed warnings such as:
and repeated performance warnings around:
These warnings appear to be secondary noise caused by repeated rendering attempts. The actual issue was a malformed message node inside
chat.history.messages.The problematic node was assigned as:
But this object was not a valid OpenWebUI message. It contained fields like:
It was missing normal message fields such as:
Browser-side validation showed:
No other message referenced this node through
childrenIds, so it appeared to be an orphan malformed node. However, sincehistory.currentIdpointed to it, the chat page could not render and stayed in infinite Loading.Steps to Reproduce
There are two related reproduction paths: the real-world provider-triggered path and an isolated malformed-chat-data path.
A. Real-world provider-triggered reproduction
chat.history.currentIdpoints to a malformed object inchat.history.messages.B. Isolated data-level reproduction
This is the minimal condition that appears to trigger the frontend issue:
chat.history.currentIdpoints to a key inchat.history.messages.Validation script used in browser console
The output was:
Logs & Screenshots
Browser console logs
The browser console repeatedly showed:
Repeated rendering / performance warnings:
API response check
The chat endpoint returned HTTP 200:
But the frontend still showed infinite Loading.
Active task check
I also tried:
In my environment this returned HTML instead of JSON:
Further inspection showed:
So this endpoint was not useful in my current version/setup.
Unfinished message check
I checked whether any messages had
done: falseor pending status:The result was:
So this was not a normal unfinished-generation state.
Malformed node details
The problematic node was:
Its keys were:
It did not contain:
The content included:
Docker logs
Relevant container logs around restart showed normal startup messages such as:
No clear backend exception was visible in the short log excerpt I checked.
Manual database repair output
I manually repaired the SQLite database by deleting the malformed orphan node and setting
history.currentIdto the last valid leaf message.Repair output:
Additional Information
Root cause hypothesis
The immediate cause appears to be:
The trigger was an upstream provider-side safety rejection:
However, the safety rejection itself should not permanently break a chat. The more important issue is that the rejected provider response appears to have been saved into
chat.history.messageswithout being normalized into OpenWebUI's expected message schema.The malformed object looked more like a raw provider response or Responses-API-style object:
instead of a valid chat message object:
Why this matters
This issue significantly increases troubleshooting cost:
Suggested frontend safeguard
Before rendering the current message, OpenWebUI could validate the node:
The UI could show a message such as:
Suggested backend safeguard
Before saving a provider response into chat history, OpenWebUI could enforce a minimal message schema:
If an upstream response contains fields like:
but does not contain
roleorchildrenIds, it should not be inserted directly intohistory.messages.Suggested repair behavior
OpenWebUI could provide an automatic safe repair mechanism:
history.currentIdexists.history.messages[history.currentId]is a valid message object.history.currentIdto that valid leaf message.Related upstream provider behavior
The upstream provider in this case was Xiaomi MiMo API through an OpenAI-compatible endpoint.
I understand that the upstream provider should also return a valid OpenAI-compatible response for rejected requests. However, OpenWebUI can still protect users by validating message objects before saving them and by handling invalid
currentIdtargets gracefully during rendering.This would make OpenWebUI more robust when dealing with third-party OpenAI-compatible providers, gateways, proxies, and safety-filter rejection responses.
AI assistance disclosure
This issue was drafted with AI assistance based on a real debugging session, browser console output, OpenWebUI chat JSON inspection, and a manual SQLite repair process provided by the user.
AI assistance details:
Model parameter and performance disclosure: