[GH-ISSUE #24775] fix: Prefer source_url for API-uploaded document citations #107396

Closed
opened 2026-05-18 06:11:56 -05:00 by GiteaMirror · 2 comments
Owner

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

  • I searched open and closed issues, pull requests, and discussions for comparable reports.
  • I can reproduce this with an Open WebUI dev-based container setup.

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

  1. Upload a document through the API with metadata such as {"source_url": "https://gitlab.example.com/group/project/-/blob/main/docs/spec.md"}.
  2. Process the file and use it in chat/RAG.
  3. Open the generated citation.

Expected: the citation link opens the provided source_url.
Actual: the citation can fall back to Open WebUI's internal file endpoint.

Alternatives Considered

  • Use "upload a webpage": not viable when Open WebUI cannot reach the source network.
  • Always link internal files: works for local uploads, but loses the authoritative upstream source for API-ingested documents.
  • Add a new setting: unnecessary; preferring explicit source metadata is a smaller and more predictable change.

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.

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 - [x] I searched open and closed issues, pull requests, and discussions for comparable reports. - [x] I can reproduce this with an Open WebUI dev-based container setup. ## 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 1. Upload a document through the API with metadata such as `{"source_url": "https://gitlab.example.com/group/project/-/blob/main/docs/spec.md"}`. 2. Process the file and use it in chat/RAG. 3. Open the generated citation. Expected: the citation link opens the provided `source_url`. Actual: the citation can fall back to Open WebUI's internal file endpoint. ## Alternatives Considered - Use "upload a webpage": not viable when Open WebUI cannot reach the source network. - Always link internal files: works for local uploads, but loses the authoritative upstream source for API-ingested documents. - Add a new setting: unnecessary; preferring explicit source metadata is a smaller and more predictable change. ## 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.
Author
Owner

@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:

  1. 🟣 #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

  2. 🟣 #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

  3. 🟣 #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.

<!-- gh-comment-id:4462588549 --> @owui-terminator[bot] commented on GitHub (May 15, 2026): <!-- terminator-bot:related-issues-reply --> 🔍 **Related Issues Found** I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions: 1. 🟣 [#11512](https://github.com/open-webui/open-webui/issues/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* 2. 🟣 [#18144](https://github.com/open-webui/open-webui/issues/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* 3. 🟣 [#10688](https://github.com/open-webui/open-webui/issues/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.
Author
Owner

@Classic298 commented on GitHub (May 15, 2026):

you opened this as issue and discussion - AGAIN - like the other issue. why? Closing.

<!-- gh-comment-id:4462634124 --> @Classic298 commented on GitHub (May 15, 2026): you opened this as issue and discussion - AGAIN - like the other issue. why? Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#107396