mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 14:13:08 -05:00
issue: UI freezes when querying a model with mixed-distance in knowledge base sources #6756
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 @silentoplayz on GitHub (Oct 24, 2025).
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.34
Ollama Version (if applicable)
v0.12.6
Operating System
Ubuntu 24.04.3 LTS
Browser (if applicable)
Mozilla Firefox Snap for Ubuntu - v144.0 (64-bit)
Confirmation
README.md.Expected Behavior
After sending a query to the model, the UI should display the model's response in the chat window. The application should remain responsive, and no JavaScript errors should appear in the browser console.
Actual Behavior
The model fails to respond visually, and the UI becomes unresponsive (freezes). The browser console shows two JavaScript errors, preventing any further interaction with the chat interface until the page is refreshed. The chat itself should be considered dead/broken.
Steps to Reproduce
Start with a clean Ubuntu 24.04.3 LTS install.
Install the latest version of Docker and start the service.
Run
docker run -d -p 3000:8080 -e OLLAMA_BASE_URL=http://host.docker.internal:11434 --add-host=host.docker.internal:host-gateway --name open-webui ghcr.io/open-webui/open-webui:mainOpen your web browser and navigate to http://localhost:3000
Create first account (Superadmin)
Go to
Workspace→Knowledge→New Knowledge.Name this new knowledge-base collection something like

KB - Publicand keep it public. Add a file to it.Create once more knowledge-base collection and name it something like

KB - Private. Add a file to it and set the collection's visibility fromPublic(by default) toPrivate.Go to
Admin Panel→Settings→Models→Edit pencil icon for a model.Attach both
KB - PublicandKB - Privateto the model.Click on the attached
KB - Publicknowledge-base collection and toggleUsing Entire Documentso that the toggle is set to an enabled position.## Ensure it looks EXACTLY like this (public knowledgebase shown first, private shown second)Save & Updatechanges to the model.Logs & Screenshots
Browser Console Errors:
Additional Information
Using Entire Documentsetting enabled at the model level.Using Entire Documentsetting provides document content without adistance(relevance) score, while the standard retrieval method does. This creates a mix of citation sources—some with distance scores and some without—which exposed the initialization bug in the frontend.Agentic AI analysis
The root cause of this bug lies in the
Citations.sveltecomponent. When processing citation sources, the code attempts to push adistancevalue to anexistingSource.distancesarray. However, thedistancesarray is initialized asundefinedif the first document processed for a given source does not have adistancevalue.When a subsequent document for the same source does have a
distancevalue, the code tries to call.push()onundefined, triggering aTypeErrorthat freezes the UI.File:
src/lib/components/chat/Messages/Citations.svelteProblematic Code:
When a source is first encountered,
distancesis set toundefinedifdistanceis not present. If a later document for the same source does have adistance, theexistingSource.distances.push(distance)line will fail.Suggested Fix:
Initialize
distancesas an empty array[]instead ofundefinedwhen a new source is added to the accumulator.