mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 12:58:11 -05:00
[PR #14362] [MERGED] Fix/chat engagement critical #23450
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/14362
Author: @PVBLIC-F
Created: 5/26/2025
Status: ✅ Merged
Merged: 5/26/2025
Merged by: @tjbck
Base:
dev← Head:fix/chat-engagement-critical📝 Commits (2)
d414662fix: resolve chat engagement TypeError - Fix get_message_list() to return [] instead of None - Fix middleware to use correct metadata message_id - Add safe fallback for missing role field - Ensure assistant messages include role field256034eUpdate misc.py📊 Changes
2 files changed (+9 additions, -4 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+3 -2)📝
backend/open_webui/utils/misc.py(+6 -2)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Added
Changed
Deprecated
Removed
Fixed
-The update resolved these specific issues:
TypeError: 'NoneType' object is not iterable
Root cause: get_message_list() returned None instead of []
Fix: Now returns empty list [] for safe iteration
KeyError: 'role' in background tasks
Root cause: Messages missing required "role" field
Fix: Added safe fallback message.get("role", "assistant")
message_id=None warnings
Root cause: Wrong metadata access in middleware
Fix: Use correct metadata["message_id"] instead of message.get("id")
Security
Breaking Changes
Additional Information
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.