mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #24775] fix: Prefer source_url for API-uploaded document citations #107396
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 @DuncanSARapp on GitHub (May 15, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24775
Related discussion: https://github.com/open-webui/open-webui/discussions/24773
Pre-submission checks
Problem Description
When documents are uploaded through the API with an authoritative source URL, citations may still point to Open WebUI's internal file URL instead of the provided upstream source URL.
This is a problem for deployments where ingestion pipelines can access internal systems that Open WebUI cannot access directly, while users can access the original source in their browser.
Expected Behavior
When citation metadata includes a source URL, Open WebUI should use that URL for citation links before falling back to the internal file endpoint.
Existing behavior should be preserved when no valid source URL is present.
Actual Behavior
Citations can fall back to Open WebUI's internal file endpoint even when the uploaded document includes source URL metadata.
Steps to Reproduce
{"source_url": "https://gitlab.example.com/group/project/-/blob/main/docs/spec.md"}.Expected: the citation link opens the provided
source_url.Actual: the citation can fall back to Open WebUI's internal file endpoint.
Alternatives Considered
Additional Context
This helps API ingestion pipelines preserve useful citation links without requiring Open WebUI to have direct network access to every upstream document system.
Tested with a local Podman container and targeted unit tests.
@owui-terminator[bot] commented on GitHub (May 15, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟣 #11512 feat: Allow clickable URLS as sources for documents.
This is the closest match: it requests clickable URL sources for documents uploaded through the API, which is the same general feature area as preferring an upstream source URL over an internal file link.
by icsy7867
🟣 #18144 Issue #18144
This issue is about making uploaded documents available in raw form for other usages, which overlaps with preserving upstream document identity/URL metadata during ingestion and citation handling.
by unknown
🟣 #10688 citations via endpoint API
Although narrower, it asks how citations are exposed via the endpoint API, so it is directly related to citation generation and API-based retrieval of sources.
by Ashbajawed
💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@Classic298 commented on GitHub (May 15, 2026):
you opened this as issue and discussion - AGAIN - like the other issue. why? Closing.