fix: pass file.meta through to vector DB chunks on file upload (#29499)

Custom metadata attached to a file upload (e.g. via the API's
metadata field) was stored on the file row but silently dropped
when the file was chunked and embedded for RAG, so it never reached
the LLM through retrieved sources.

process_file() builds chunk metadata in several branches; three of
them already merge the file's meta dict in, but the branch used for
a fresh upload processed through a document loader did not. Bring
it in line with the others so custom metadata flows through
consistently regardless of upload path.

Reported in open-webui/open-webui#29486.
This commit is contained in:
Classic298 2026-09-03 20:57:50 +02:00 committed by GitHub
parent aa48106fca
commit 8ba8786d6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1967,6 +1967,7 @@ async def process_file(
Document(
page_content=doc.page_content,
metadata={
**file.meta,
**filter_metadata(doc.metadata),
'name': file.filename,
'created_by': file.user_id,