mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-12 14:45:38 -06:00
[PR #22673] [CLOSED] fix: bypass RAG retrieval when all files are in full context mode #81680
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22673
Author: @a86582751
Created: 3/14/2026
Status: ❌ Closed
Base:
main← Head:fix-full-context-bypass-rag📝 Commits (1)
70fe715fix: bypass RAG retrieval when all files are in full context mode📊 Changes
1 file changed (+51 additions, -30 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+51 -30)📄 Description
Problem
When all uploaded files have
context="full"(Full Context mode), the code was still:get_sources_from_itemswithfull_context=Truequeries_generatedstatusThis caused unnecessary retrieval processing and UI delays even when users explicitly selected Full Context mode expecting direct file content injection without RAG.
Bug Manifestation / 具体表现形式
现象 1: "检索中"状态依然存在
用户操作: 在模型选项卡中勾选 "完整上下文" (Full Context),上传文档
预期行为: 直接传递文档内容,不经过 RAG
实际行为:
现象 2: 角色扮演场景性能灾难
用户场景: 上传 50KB+ 的角色扮演剧情文档,让 AI 接着剧情继续
预期行为: AI 直接阅读完整文档,无缝衔接剧情
实际行为:
现象 3: 无法真正关闭 RAG
用户操作: 在设置 → 文档中勾选 "绕过嵌入和检索"
预期行为: 完全跳过 RAG,直接传递原始文件
实际行为:
Root Cause
在
chat_completion_files_handler中:Solution
When
all_full_contextisTrue:queries_generatedstatus emissionget_sources_from_itemswith minimal parametersChanges
chat_completion_files_handlerinbackend/open_webui/utils/middleware.pyall_full_contextvs normal RAGTesting
Related
Fixes the issue where 'Full Context' mode still triggered RAG processing, causing performance problems with large roleplay documents where time continuity is critical.
Signed-off-by: Pyrite Prof pyrite@example.com
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.