mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-08 03:08:02 +00:00
fix: stream reasoning deltas when the provider also sends reasoning_details
Providers such as OpenRouter emit reasoning_details alongside the reasoning text on the same delta. Merging those details cleared the pending event unconditionally, discarding the response.reasoning_text.delta that had just been built, so the client received no reasoning until the response completed and the thinking block only appeared after generation finished. The event is now only dropped when the details were all there was to report. Details persistence is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014uuEg4AXPs9zE3vVUfN1Fj
This commit is contained in:
parent
5d7fc35eda
commit
56177f34fd
1 changed files with 6 additions and 1 deletions
|
|
@ -5222,7 +5222,12 @@ async def streaming_chat_response_handler(response, ctx):
|
|||
reasoning_detail_items,
|
||||
)
|
||||
await save_current_response_stream()
|
||||
data = None
|
||||
# Providers such as OpenRouter send reasoning_details
|
||||
# alongside the reasoning text: only drop the event when
|
||||
# the details were all there was to report, otherwise the
|
||||
# reasoning delta never reaches the client.
|
||||
if not reasoning_content:
|
||||
data = None
|
||||
|
||||
if value:
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue