mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #21645] issue: websearch with Native mode and API Responses not working #19544
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 @MarceloMassarente on GitHub (Feb 20, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21645
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.8.3
Ollama Version (if applicable)
No response
Operating System
Ubuntu
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
with API Response set, and Native mode, GPT-5 should behave like in Standard, launch websearch and get the answer back to the chat
Actual Behavior
The websearch launches, immediatelly the chat bar becomes ready again, and after sometime there is an error in the logs
KeyError: 'choices'
...
response = res["choices"][0]["message"]["content"]
...
res = {'id': 'resp_...', 'object': 'response', ...}
Steps to Reproduce
run any websearch with API Response, Native mode and websearch available
Logs & Screenshots
i/v1/chats/?page=1 HTTP/1.1" 200
2026-02-20 08:09:07.886 | ERROR | open_webui.utils.middleware:chat_web_search_handler:1316 - 'choices'
Traceback (most recent call last):
File "/usr/local/bin/open-webui", line 8, in
File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 1135, in call
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1485, in call
File "/usr/local/lib/python3.11/site-packages/typer/core.py", line 813, in main
File "/usr/local/lib/python3.11/site-packages/typer/core.py", line 189, in _main
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1873, in invoke
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1269, in invoke
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 824, in invoke
File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 1514, in wrapper
File "/usr/local/lib/python3.11/site-packages/open_webui/init.py", line 78, in serve
File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 594, in run
File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run
File "/usr/local/lib/python3.11/site-packages/uvicorn/_compat.py", line 30, in asyncio_run
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
File "/usr/local/lib/python3.11/site-packages/open_webui/main.py", line 1787, in process_chat
File "/usr/local/lib/python3.11/site-packages/open_webui/utils/middleware.py", line 2172, in process_chat_payload
KeyError: 'choices'
Additional Information
No response
@tjbck commented on GitHub (Feb 22, 2026):
Status: Open.
#21340