mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #21207] [CLOSED] fix: handle error dict in citation parser when web search fails #64822
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/21207
Author: @veeceey
Created: 2/6/2026
Status: ❌ Closed
Base:
main← Head:fix/issue-21070-citation-parser-error📝 Commits (1)
7b0442cfix: handle error dict responses in citation parser to prevent AttributeError📊 Changes
1 file changed (+8 additions, -3 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+8 -3)📄 Description
Summary
search_webfail (timeout, API error, etc.), they return{"error": "..."}as a JSON dict. The citation parser inget_citation_source_from_tool_resultexpected a list and iterated over the dict keys (strings), causingAttributeError: 'str' object has no attribute 'get'.json.loadscalls.Fixes #21070
Test plan
view_knowledge_fileandquery_knowledge_filescitations still work correctly.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.