issue: Responses API conversion drops tool calls and incorrectly converts forced tool_choice
Before Submitting
- I searched open and closed issues and discussions for an existing report.
- I checked whether this is already fixed on the
devbranch or latest source. - I understand that maintainers want a well-written issue before any code pull request.
- I am using the latest available version of Open WebUI for my install method.
- This is not a security vulnerability.
Installation Method
Docker
Open WebUI Version
0.11.3
Operating System
Debian 12
Browser
All
Ollama Version
No response
Summary
When an OpenAI-compatible model is configured to use the Responses API, tool-call conversion is incomplete in two places.
A forced Chat Completions tool_choice is forwarded in the nested Chat Completions format instead of being converted to the flat Responses API format. Additionally, non-streaming Responses API function_call output items are dropped when the response is converted back to Chat Completions format.
Expected Behavior
A forced function choice should be converted from the Chat Completions format:
{
"type": "function",
"function": {
"name": "get_weather"
}
}
to the Responses API format:
{
"type": "function",
"name": "get_weather"
}
For non-streaming responses, every Responses API function_call output item should be converted to a Chat Completions tool_calls entry. The function name, call ID, and arguments should be preserved, and finish_reason should be set to "tool_calls".
Responses containing only text should continue to use finish_reason: "stop".
Actual Behavior
Actual Behavior
The forced tool_choice remains in the nested Chat Completions format when sent to the Responses API. Strict Responses API providers may reject the request because they expect name at the top level of the tool_choice object.
For non-streaming responses, the conversion currently extracts only output_text. Responses API function_call output items are ignored. The resulting Chat Completions response therefore has no tool_calls and incorrectly reports finish_reason: "stop".
As a result, downstream Open WebUI processing does not see or execute the requested tool call.
Steps to Reproduce
- Configure an OpenAI-compatible connection in Open WebUI with the Responses API enabled.
- Select a model that supports function/tool calling.
- Enable native function calling.
- Send a non-streaming chat completion with a function definition and a forced function choice:
curl http://localhost:3000/api/chat/completions \
-H "Authorization: Bearer <OPEN_WEBUI_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "<MODEL_ID>",
"stream": false,
"messages": [
{
"role": "user",
"content": "What is the weather in London?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string"
}
},
"required": ["location"]
}
}
}
],
"tool_choice": {
"type": "function",
"function": {
"name": "get_weather"
}
}
}'
- Observe that the upstream Responses API receives the incorrect nested tool_choice format and may reject the request.
- Alternatively, use tool_choice: "auto" and prompt the model to call the tool.
- When the upstream non-streaming response contains a function_call output item, observe that the returned Chat Completions response contains no tool_calls and uses finish_reason: "stop".
Logs, Screenshots, and Config
Tool calls are simply not working.
Additional Information
No response
Source: open-webui/open-webui