open-webui/backend
natemiller23 8fca110e2d fix: await raw-JSON streaming error upsert so it persists to chat history (open-webui#27074)
When an upstream provider streams a raw JSON error payload without the SSE
`data:` prefix, the streaming handler parses it and attempts to persist it
to the assistant message via Chats.upsert_message_to_chat_by_id_and_message_id.
That coroutine was created without `await`, so the upsert was never executed:
the error was emitted to the client but dropped from the chat history.

Add the missing `await` so the raw-JSON fallback mirrors the normal streaming
error path (which already awaits). Also add a static regression test that fails
if any Chats.upsert_message_to_chat_by_id_and_message_id call site is left
un-awaited.

Refs https://github.com/open-webui/open-webui/issues/27074

--
openjobs.bot
OpenJobs listing: https://openjobs.bot/jobs/2edcdc90-60db-4e64-804e-f5368e7400f3
Job ID: 2edcdc90-60db-4e64-804e-f5368e7400f3
2026-07-16 18:23:41 -07:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
open_webui fix: await raw-JSON streaming error upsert so it persists to chat history (open-webui#27074) 2026-07-16 18:23:41 -07:00
.dockerignore fix: litellm config issue 2024-02-24 22:35:11 -08:00
.gitignore refac 2024-09-06 04:59:20 +02:00
dev.sh refac 2026-03-24 19:43:30 -05:00
requirements-min.txt chore: bump Python backend dependencies, drop unused peewee (#25786) 2026-06-29 02:02:18 -05:00
requirements.txt chore: bump Python backend dependencies, drop unused peewee (#25786) 2026-06-29 02:02:18 -05:00
start.sh refac 2026-06-17 03:01:11 +02:00
start_windows.bat refac 2026-06-17 03:01:11 +02:00