mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #16855] issue: The process_chat_payload method in middleware.py has an issue with duplicate system prompts
#72679
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?
Originally created by @webboyvc on GitHub (Aug 23, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16855
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
main branch
Ollama Version (if applicable)
No response
Operating System
linux
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
I remotely invoked the /api/chat/completions interface, and the data in the body is as follows:
{
"model":"qwen3:30b",
"stream":false,
"think":false,
"messages":[
{"role":"system","content":"You are an assistant!!!"},
{"role":"user","content":"who are you"}
]
}
When I set a breakpoint under the function process_chat_payload, I view the value of the variable form_data is:
[{'role': 'system', 'content': 'You are an assistant!!!\nYou are an assistant!!!'}, {'role': 'user', 'content': 'who are you'}]
but the correct value should be:
[{'role': 'system', 'content': 'You are an assistant!!!'}, {'role': 'user', 'content': 'who are you'}]
Actual Behavior
[{'role': 'system', 'content': 'You are an assistant!!!\nYou are an assistant!!!'}, {'role': 'user', 'content': 'who are you'}]
Steps to Reproduce
Go to line 744 of the file middleware.py
Logs & Screenshots
[{'role': 'system', 'content': 'You are an assistant!!!\nYou are an assistant!!!'}, {'role': 'user', 'content': 'who are you'}]
Additional Information
No response
@tjbck commented on GitHub (Sep 7, 2025):
#17198