mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #17516] [CLOSED] fix: handle None usage data in chat response processing #47501
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/17516
Author: @NibbinNone
Created: 9/17/2025
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (1)
663410cfix: handle None usage data in chat response processing📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+1 -1)📄 Description
Update usage data handling to use 'or {}' instead of default parameter to properly handle None values from API responses.
some api server return data like
The code
usage = data.get("usage", {})gets None, which causes the open-webui to not display the message correctly.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.