mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-11 10:34:13 -05:00
[GH-ISSUE #22513] issue: Bug: XML file content is corrupted (XML tags stripped) when uploaded in non-temporary chat #74332
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 @nekomiya-hinata on GitHub (Mar 10, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22513
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.8.10
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When "Bypass Embedding and Retrieval" is enabled in Settings > Documents,
the complete and unmodified file content should be sent to the LLM,
including all XML tags and structure.
Actual Behavior
When uploading XML files (e.g., logback-spring.xml, MyBatis mapper XML) in a
normal (non-temporary) chat with "Bypass Embedding and Retrieval" enabled,
all XML tags are stripped from the file content before being sent to the LLM.
Only the text nodes between tags are preserved.
However, the same files uploaded in Temporary Chat mode are sent completely
and correctly.
Steps to Reproduce
Observe: All XML tags are stripped. Only text node content remains.
For comparison:
7. Start a Temporary Chat and repeat steps 4–6.
Observe: File content is complete and all XML tags are preserved.
Logs & Screenshots
Normal chat, "Bypass Embedding and Retrieval" enabled.
XML tags are stripped from the content inside tag.
Same file uploaded in Temporary Chat mode. Content is complete.
Additional Information
Root cause hypothesis:
In normal chat mode, uploaded files go through an ingestion pipeline
(extraction → storage to DB). During this step, the content extractor
appears to parse the XML file as a markup document and strips all tags,
storing only the inner text in the database.
"Bypass Embedding and Retrieval" only skips the vector search/retrieval step,
but the file content retrieved from DB is already corrupted at this point.
In Temporary Chat mode, the raw file is read directly without going through
the ingestion pipeline, so the content is intact.
Suggested fix: Either (1) bypass the extraction step as well when
"Bypass Embedding and Retrieval" is enabled, or (2) treat non-document
files (XML, JSON, YAML, etc.) as plain text and skip markup parsing entirely.
@nekomiya-hinata commented on GitHub (Mar 10, 2026):
Suggested Fix
For configuration files like XML, JSON, YAML, etc., they should be treated as plain text without markup parsing. Consider adding a check in the
_get_loader()method to useTextLoaderdirectly for these file types, skipping BeautifulSoup processing entirely. This would preserve the original file structure and prevent tag stripping.