mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23929] [CLOSED] fix: only set finish_reason 'stop' on final SSE chunk when usage is present #50489
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/23929
Author: @pvyswiss
Created: 4/21/2026
Status: ❌ Closed
Base:
main← Head:fix/premature-finish-reason-stop📝 Commits (1)
4595d01fix: only set finish_reason 'stop' on final SSE chunk (when usage present)📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/misc.py(+1 -1)📄 Description
Summary
Fixes #23921 (Ref: #23917 Bug 2)
misc.py: addusage andto thefinish_reasonconditioncontent/thinkingstrings from Ollama's first chunk are falsy in Pythonfinish_reason: "stop"on the very first SSE chunk🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.