mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #19102] [CLOSED] fix: template query placeholder escaping logic #40720
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/19102
Author: @matiboux
Created: 11/11/2025
Status: ❌ Closed
Base:
dev← Head:fix/rag-template-query-placeholder📝 Commits (1)
d009c9bFix template query placeholder escaping logic📊 Changes
1 file changed (+6 additions, -10 deletions)
View changed files
📝
backend/open_webui/utils/task.py(+6 -10)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch will lead to immediate closure of the PR.Changelog Entry
Description
rag_templatefunction withinbackend/open_webui/utils/task.pyto simplify, fix, and improve handling of[query]and{{QUERY}}placeholders.Added
None.
Changed
[query]and{{QUERY}}strings inbackend/open_webui/utils/task.py.Deprecated
None.
Removed
None.
Fixed
backend/open_webui/utils/task.py.Security
None.
Breaking Changes
None.
Additional Information
This PR addresses & fixes #19101.
Updated prompts were manually tested and verified using a proxy OpenAI-compatible proxy API to inspect system & user messages.
LLM Chat Query prompt with changes from this PR:
This PR specifically addresses the code responsible for the escaping faulty logic:
e0d5de1697/backend/open_webui/utils/task.py (L207-L224)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.