Files
open-webui/backend/open_webui/utils
Classic298 798f3935ae fix: keep streamed Responses output when response.completed reports an empty output array (#27800)
The `response.completed` handler replaced the accumulated output with the terminal event's `output` whenever that key was present, guarded only by `is not None`. An empty array satisfies that guard, so a provider that finishes the stream with `"output": []` wiped everything collected from `response.output_item.added`, `response.output_text.delta` and `response.output_item.done`.

The assistant message was then persisted with `output: []` and empty content, which shows up as a reply that renders correctly while streaming and disappears the moment the stream ends.

Fall back to the accumulated output when the terminal array is empty. A spec-compliant `response.completed` still wins, since a populated array is truthy, and when nothing was streamed the accumulated output is empty too, so the fallback cannot invent content.

Fixes #27789
2026-07-31 19:09:32 -05:00
..
2026-06-29 11:56:00 -05:00
2026-07-31 17:41:14 -04:00
2026-07-31 17:41:14 -04:00
2026-07-31 17:30:47 -04:00
2026-03-17 17:58:01 -05:00
2026-07-23 02:54:56 -04:00
2026-07-26 21:12:14 -04:00
2026-07-31 17:41:14 -04:00
2026-07-31 17:41:14 -04:00
2026-07-31 17:41:14 -04:00
2026-07-23 21:29:33 -04:00
2026-07-27 00:12:47 -04:00
2026-07-31 17:45:07 -04:00
2026-07-31 17:41:14 -04:00
2026-07-31 17:41:14 -04:00
2026-07-26 23:09:22 -04:00
2026-07-27 19:39:36 -04:00
2026-07-31 17:41:14 -04:00
2026-07-23 19:17:19 -04:00
2026-07-31 17:41:14 -04:00
2026-03-17 17:58:01 -05:00
2026-07-27 04:17:00 -04:00
2026-07-31 17:41:14 -04:00
2026-06-19 00:16:06 +02:00
2026-07-10 18:32:21 -05:00
2026-07-31 17:41:14 -04:00
2026-07-27 19:39:36 -04:00
2026-07-31 17:41:14 -04:00