mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #23922] fix: Missing delta.role and non-unique chunk IDs in Ollama-to-OpenAI SSE conversion #35638
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?
Originally created by @pvyswiss on GitHub (Apr 21, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23922
Bug Description
API clients fail to correlate SSE chunks or initialize the response correctly. Some SDKs silently drop chunks or fail to render content.
Related to: #23917 (Bug 3)
Root Cause (Two Issues)
3a: Missing
delta.role: "assistant"on first chunkThe OpenAI SSE spec requires the first chunk to contain
delta.role: "assistant". The Ollama-to-OpenAI conversion never emitsrole. OpenAI-compatible SDKs expect this field.3b: Unique UUID per SSE chunk
openai_chat_message_template()generates a newuuid4()per chunk. The OpenAI spec requires all chunks in a completion to share the sameid. SDKs use this for chunk correlation.Fix
Impact
idordelta.role)File
backend/open_webui/utils/response.py@tjbck commented on GitHub (Apr 24, 2026):
Addressed in dev.