mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #22674] [CLOSED] fix: bypass RAG retrieval when all files are in full context mode #49856
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22674
Author: @a86582751
Created: 3/14/2026
Status: ❌ Closed
Base:
dev← Head:fix-full-context-bypass-rag📝 Commits (10+)
fe6783cMerge pull request #19030 from open-webui/devfc05e0aMerge pull request #19405 from open-webui/deve3faec6Merge pull request #19416 from open-webui/dev9899293Merge pull request #19448 from open-webui/dev140605eMerge pull request #19462 from open-webui/dev6f1486fMerge pull request #19466 from open-webui/devd95f533Merge pull request #19729 from open-webui/deva7271530.6.43 (#20093)6adde20Merge pull request #20394 from open-webui/devf9b0534Merge pull request #20522 from open-webui/dev📊 Changes
1 file changed (+51 additions, -30 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+51 -30)📄 Description
Pull Request Checklist
Before submitting, ensure you have:
Description
Fixes the issue where 'Full Context' mode and 'Bypass Embedding and Retrieval' setting still triggered unnecessary RAG processing.
Problem
When either:
context="full"(Full Context mode), ORBYPASS_EMBEDDING_AND_RETRIEVALis enabled (Admin Settings → Documents)The code was still:
get_sources_from_itemswithfull_context=Truequeries_generatedstatusThis caused unnecessary retrieval processing and UI delays even when users explicitly expected direct file content injection without RAG.
Bug Manifestation
现象 1: "检索中"状态依然存在(完整文档模式)
现象 2: "检索中"状态依然存在(全局绕过设置)
现象 3: 角色扮演场景性能灾难
Affected Settings
| 设置位置 | 设置名称 | 问题 ||---------|---------|------|| 聊天文件模态框 | 完整文档 (Full Context) | 勾选后仍触发检索流程 || Admin → Documents | 绕过嵌入和检索 (Bypass Embedding) | 启用后仍触发检索流程 |
Solution
When
all_full_contextisTrueORbypass_embeddingisTrue:queries_generatedstatus emissionget_sources_from_itemswith minimal parametersChanges
chat_completion_files_handlerinbackend/open_webui/utils/middleware.pyrequest.app.state.config.BYPASS_EMBEDDING_AND_RETRIEVALTesting
Screenshots / Evidence
N/A - Backend logic change
Changelog Entry
Fixed
Additional Information
CLA
I have read the CLA Document and I hereby sign the CLA
Type of Change
Testing Environment
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.