Conversation
Indexed chunks keep the filename from when the file was processed, so sources and the citation panel stayed on the old name after a rename. Read the current filename when those citations are built.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Do not open a code pull request unless a maintainer has explicitly requested it or the change is limited to i18n/localization.
The most useful way to help is to give us a clear understanding of the problem: report reproducible bugs in Issues and share proposals in Discussions. We use that context to evaluate solutions and refine the implementation internally, accounting for the broader codebase and ongoing work. External implementations usually require substantial reworking to fit the project's standards, and coordinating those revisions usually takes more effort than developing the solution internally. Please follow this process before investing time in a pull request. PRs opened outside these guidelines are generally closed without review.
Maintainer Request
No maintainer request. Draft only, so it does not take a ready-for-review slot. Relates to open-webui#30318.
Checklist
devbranch.Relates to open-webui/open-webui#30318.Title Prefix
Use one of the following prefixes:
Summary
Renaming a knowledge-base file updates the file record, but each indexed chunk still carries the filename copied in at process time. New chats then cite that stale name in the source chip and the citation panel.
When sources are built,
nameandsourceon chunks that belong to a real file are replaced with the current filename from the files table. Deleted files, external documents, and URL sources keep the stored value. The same resolution is applied toquery_knowledge_files, which builds citations from those chunks directly.Verification
Reproduced the stale-name path from the issue description: chunk metadata is written with
file.filenameinprocess_file, andrename_file_by_idupdates only the file row. Citations rendermetadata.name, and group onmetadata.source.Checked the resolver against the cases that matter: a renamed file overwrites both fields, a second chunk for the same id does one lookup, a missing file and an empty filename stay unchanged,
externalmetadata andexternal-ids stay unchanged, andhttp:///https://values stay unchanged so link citations keep their URL.I did not run the full app, upload a knowledge file, rename it, and open a chat. That needs a running stack, embeddings, and a vector database.
Changelog Entry
Added
Changed
Fixed
Removed
Security
Breaking Changes
Additional Context
Draft. Not requested by a maintainer. Issue open-webui#30318 is still open; an earlier pull request (open-webui#30344) was closed without merge and targeted
main.Contributor License Agreement