mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-05 00:10:27 -05:00
[PR #17933] [CLOSED] fix: keep tool result from triggering addition of rag template #63461
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/17933
Author: @kjpoccia
Created: 9/30/2025
Status: ❌ Closed
Base:
dev← Head:rag-template📝 Commits (1)
8fab6adFix to keep all tool results from triggering rag template📊 Changes
1 file changed (+3 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+3 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
In v0.6.32, a regression was introduced where tool results are incorrectly treated as RAG document sources. This causes the RAG template to be injected into the system prompt whenever external tools are invoked, even when tool outputs are not document chunks from a knowledge base.
This conflates two distinct concepts:
Document retrieval from a knowledge base (should use RAG template)
Tool execution results from function calls (should NOT use RAG template)
This fix adds back in the check for whether the returned sources are tool results.
Added
None
Changed
None
Deprecated
None
Removed
None
Fixed
Security
None
Breaking Changes
None
Additional Information
None
Screenshots or Videos
None
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.