[PR #21638] [CLOSED] fix: handle string type in citation parser to prevent AttributeError #65032

Closed
opened 2026-05-06 10:47:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21638
Author: @hztBUAA
Created: 2/20/2026
Status: Closed

Base: mainHead: fix/citation-parser-type-error


📝 Commits (1)

  • 3eae45c fix: handle non-dict types in citation parser to prevent AttributeError

📊 Changes

1 file changed (+8 additions, -2 deletions)

View changed files

📝 backend/open_webui/utils/middleware.py (+8 -2)

📄 Description

contributor license agreement

Summary

  • Citation parser crashed with AttributeError: 'str' object has no attribute 'get' when web search returned error strings instead of dict objects
  • Added type guard to handle string values gracefully in the citation parsing logic

Closes #21070

Test plan

  • Verified citation parsing handles both dict and string inputs without errors

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/21638 **Author:** [@hztBUAA](https://github.com/hztBUAA) **Created:** 2/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/citation-parser-type-error` --- ### 📝 Commits (1) - [`3eae45c`](https://github.com/open-webui/open-webui/commit/3eae45c200e4579077a264a130eb5a13224f4f74) fix: handle non-dict types in citation parser to prevent AttributeError ### 📊 Changes **1 file changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+8 -2) </details> ### 📄 Description contributor license agreement ## Summary - Citation parser crashed with `AttributeError: 'str' object has no attribute 'get'` when web search returned error strings instead of dict objects - Added type guard to handle string values gracefully in the citation parsing logic Closes #21070 ## Test plan - Verified citation parsing handles both dict and string inputs without errors --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 10:47:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#65032