I have searched for any existing and/or related issues.
I have searched for any existing and/or related discussions.
I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
I am using the latest version of Open WebUI.
Installation Method
Git Clone
Open WebUI Version
v0.6.36
Ollama Version (if applicable)
No response
Operating System
Ubuntu 24.04 LTS (WSL2)
Browser (if applicable)
No response
Confirmation
I have read and followed all instructions in README.md.
I am using the latest version of both Open WebUI and Ollama.
I have included the browser console logs.
I have included the Docker container logs.
I have provided every relevant configuration, setting, and environment variable used in my setup.
I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
Start with the initial platform/version/OS and dependencies used,
Specify exact install/launch/configure commands,
List URLs visited, user input (incl. example values/emails/passwords if needed),
Describe all options and toggles enabled or changed,
Include any files or environmental changes,
Identify the expected and actual result at each stage,
Ensure any reasonably skilled user can follow and hit the same issue.
Expected Behavior
When a tool is selected, the prompt sent to the model for tool selection and calling should be clean and not contain duplicate or unclear instructions.
Actual Behavior
When a tool is selected, the prompt sent to the model for tool selection contains duplicate and unclear instructions in the user message:
Query: History:
USER: """what time is it?"""
Query: what time is it?
Primarily, the "Query:" instruction is duplicated in "Query: History:" and "Query:".
This is because of how the user message is formatted in the tool selection request:
Also, the query and last user message of the conversation is duplicated. The discussion is open as to whether this is a problem or not.
Steps to Reproduce
Start Ubuntu 24.04 LTS in WSL2.
Set up Open WebUI per documentation:
In one terminal: npm run dev to start the frontend.
In another terminal: run sh dev.sh from the backend/ directory to start the backend.
In parallel, start a custom API that proxies OpenAI-compatible requests from the /chat/completions endpoint to a real OpenAI-compatible API, and whose only other role is to print out:
All request parameters
System and user messages
In the Open WebUI interface, create the admin user.
Go to admin settings and enter a connection setting pointing to the custom OpenAI-compatible proxy API.
In Workspace, create a new tool using the default provided code.
Create a new chat with any model and enable the tool just created.
Type (or ask): "what time is it?"
Inspect the printout in the custom API terminal window: observe that both system/context and prompt are duplicated in the API request.
Note: Alternatively, you could add logs in the backend to print the request parameters, but using a custom API ensures backend code is untouched for this test.
Logs & Screenshots
Below is the actual output from the custom API proxy used during testing. This show the user message in the tool selection request.
Tool Selection Request:
Messages since the last assistant response:
- system
```
Available Tools: [{"name": "calculator", "description": "\n Calculate the result of an equation.\n ", "parameters": {"properties": {"equation": {"description": "The mathematical equation to calculate.", "type": "string"}}, "required": ["equation"], "type": "object"}}, {"name": "get_current_time", "description": "\n Get the current time in a more human-readable format.\n ", "parameters": {"properties": {}, "type": "object"}}, {"name": "get_current_weather", "description": "\n Get the current weather for a given city.\n ", "parameters": {"properties": {"city": {"default": "New York, NY", "description": "Get the current weather for a given city.", "type": "string"}}, "type": "object"}}, {"name": "get_user_name_and_email_and_id", "description": "\n Get the user name, Email and ID from the user object.\n ", "parameters": {"properties": {}, "type": "object"}}]
Your task is to choose and return the correct tool(s) from the list of available tools based on the query. Follow these guidelines:
- Return only the JSON object, without any additional text or explanation.
- If no tools match the query, return an empty array:
{
"tool_calls": []
}
- If one or more tools match the query, construct a JSON response containing a "tool_calls" array with objects that include:
- "name": The tool's name.
- "parameters": A dictionary of required parameters and their corresponding values.
The format for the JSON response is strictly:
{
"tool_calls": [
{"name": "toolName1", "parameters": {"key1": "value1"}},
{"name": "toolName2", "parameters": {"key2": "value2"}}
]
}
```
- user
```
Query: History:
USER: """what time is it?"""
Query: what time is it?
```
Additional Information
Related code responsible for the "Query:" prefix duplication:
I will create a PR to attempt to resolve this issue.
Originally created by @matiboux on GitHub (Nov 11, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19121
### Check Existing Issues
- [x] I have searched for any existing and/or related issues.
- [x] I have searched for any existing and/or related discussions.
- [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
- [x] I am using the latest version of Open WebUI.
### Installation Method
Git Clone
### Open WebUI Version
v0.6.36
### Ollama Version (if applicable)
_No response_
### Operating System
Ubuntu 24.04 LTS (WSL2)
### Browser (if applicable)
_No response_
### Confirmation
- [x] I have read and followed all instructions in `README.md`.
- [x] I am using the latest version of **both** Open WebUI and Ollama.
- [x] I have included the browser console logs.
- [x] I have included the Docker container logs.
- [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.**
- [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
- [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps:
- Start with the initial platform/version/OS and dependencies used,
- Specify exact install/launch/configure commands,
- List URLs visited, user input (incl. example values/emails/passwords if needed),
- Describe all options and toggles enabled or changed,
- Include any files or environmental changes,
- Identify the expected and actual result at each stage,
- Ensure any reasonably skilled user can follow and hit the same issue.
### Expected Behavior
When a tool is selected, the prompt sent to the model for tool selection and calling should be clean and not contain duplicate or unclear instructions.
### Actual Behavior
When a tool is selected, the prompt sent to the model for tool selection contains duplicate and unclear instructions in the user message:
```
Query: History:
USER: """what time is it?"""
Query: what time is it?
```
Primarily, the "Query:" instruction is duplicated in "Query: History:" and "Query:".
This is because of how the user message is formatted in the tool selection request:
```python
prompt = f"History:\n{chat_history}\nQuery: {user_message}"
user_message_content = f"Query: {prompt}"
```
Also, the query and last user message of the conversation is duplicated. The discussion is open as to whether this is a problem or not.
### Steps to Reproduce
1. Start Ubuntu 24.04 LTS in WSL2.
2. Set up Open WebUI per documentation:
- In one terminal: `npm run dev` to start the frontend.
- In another terminal: run `sh dev.sh` from the `backend/` directory to start the backend.
3. In parallel, start a custom API that proxies OpenAI-compatible requests from the `/chat/completions` endpoint to a real OpenAI-compatible API, and whose only other role is to print out:
- All request parameters
- System and user messages
4. In the Open WebUI interface, create the admin user.
5. Go to admin settings and enter a connection setting pointing to the custom OpenAI-compatible proxy API.
6. In Workspace, create a new tool using the default provided code.
7. Create a new chat with any model and enable the tool just created.
8. Type (or ask): "what time is it?"
9. Inspect the printout in the custom API terminal window: observe that both system/context and prompt are duplicated in the API request.
Note: Alternatively, you could add logs in the backend to print the request parameters, but using a custom API ensures backend code is untouched for this test.
### Logs & Screenshots
Below is the actual output from the custom API proxy used during testing. This show the user message in the tool selection request.
**Tool Selection Request:**
`````
Messages since the last assistant response:
- system
```
Available Tools: [{"name": "calculator", "description": "\n Calculate the result of an equation.\n ", "parameters": {"properties": {"equation": {"description": "The mathematical equation to calculate.", "type": "string"}}, "required": ["equation"], "type": "object"}}, {"name": "get_current_time", "description": "\n Get the current time in a more human-readable format.\n ", "parameters": {"properties": {}, "type": "object"}}, {"name": "get_current_weather", "description": "\n Get the current weather for a given city.\n ", "parameters": {"properties": {"city": {"default": "New York, NY", "description": "Get the current weather for a given city.", "type": "string"}}, "type": "object"}}, {"name": "get_user_name_and_email_and_id", "description": "\n Get the user name, Email and ID from the user object.\n ", "parameters": {"properties": {}, "type": "object"}}]
Your task is to choose and return the correct tool(s) from the list of available tools based on the query. Follow these guidelines:
- Return only the JSON object, without any additional text or explanation.
- If no tools match the query, return an empty array:
{
"tool_calls": []
}
- If one or more tools match the query, construct a JSON response containing a "tool_calls" array with objects that include:
- "name": The tool's name.
- "parameters": A dictionary of required parameters and their corresponding values.
The format for the JSON response is strictly:
{
"tool_calls": [
{"name": "toolName1", "parameters": {"key1": "value1"}},
{"name": "toolName2", "parameters": {"key2": "value2"}}
]
}
```
- user
```
Query: History:
USER: """what time is it?"""
Query: what time is it?
```
`````
### Additional Information
Related code responsible for the "Query:" prefix duplication:
https://github.com/open-webui/open-webui/blob/e0d5de16978786b8a7538adf1efcde5258f38faf/backend/open_webui/utils/middleware.py#L311-L321
Related code responsible for the last user message duplication:
https://github.com/open-webui/open-webui/blob/e0d5de16978786b8a7538adf1efcde5258f38faf/backend/open_webui/utils/middleware.py#L303-L311
I will create a PR to attempt to resolve this issue.
GiteaMirror
added the bug label 2026-04-20 00:59:28 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @matiboux on GitHub (Nov 11, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/19121
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.36
Ollama Version (if applicable)
No response
Operating System
Ubuntu 24.04 LTS (WSL2)
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When a tool is selected, the prompt sent to the model for tool selection and calling should be clean and not contain duplicate or unclear instructions.
Actual Behavior
When a tool is selected, the prompt sent to the model for tool selection contains duplicate and unclear instructions in the user message:
Primarily, the "Query:" instruction is duplicated in "Query: History:" and "Query:".
This is because of how the user message is formatted in the tool selection request:
Also, the query and last user message of the conversation is duplicated. The discussion is open as to whether this is a problem or not.
Steps to Reproduce
npm run devto start the frontend.sh dev.shfrom thebackend/directory to start the backend./chat/completionsendpoint to a real OpenAI-compatible API, and whose only other role is to print out:Note: Alternatively, you could add logs in the backend to print the request parameters, but using a custom API ensures backend code is untouched for this test.
Logs & Screenshots
Below is the actual output from the custom API proxy used during testing. This show the user message in the tool selection request.
Tool Selection Request:
Additional Information
Related code responsible for the "Query:" prefix duplication:
https://github.com/open-webui/open-webui/blob/e0d5de16978786b8a7538adf1efcde5258f38faf/backend/open_webui/utils/middleware.py#L311-L321
Related code responsible for the last user message duplication:
https://github.com/open-webui/open-webui/blob/e0d5de16978786b8a7538adf1efcde5258f38faf/backend/open_webui/utils/middleware.py#L303-L311
I will create a PR to attempt to resolve this issue.