Files
open-webui/backend/open_webui/utils
Classic298 d75a7aaf54 fix: surface upstream errors on arena models instead of crashing (#29662)
Sending a message to an arena model failed with "'JSONResponse' object has no attribute 'body_iterator'" whenever the backing provider answered with an HTTP error, so the real error never reached the user. Non-streaming requests on an arena model, such as title and tag generation, broke the same way with "'JSONResponse' object is not a mapping".

The arena wrapper assumed the sub-model call always returns a stream for a streaming request and a dict for everything else, but the OpenAI-compatible router returns a plain response object as soon as the provider answers 4xx or 5xx. Both arms now hand that response straight back, which is exactly what the non-arena path already does, so the existing error handling turns it into the usual error message in the chat.

Verified against a matrix of streaming and non-streaming requests with the sub-model returning a stream, a dict, a JSONResponse and a PlainTextResponse: both crashes are gone and the two success paths are unchanged, including the selected_model_id prelude on the stream.

Fixes #29658
2026-09-04 17:17:02 -04:00
..
2026-06-29 11:56:00 -05:00
2026-08-24 18:29:36 -04:00
2026-08-31 01:06:15 -04:00
2026-08-29 16:14:32 -04: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-08-23 13:36:53 -04:00
2026-08-31 00:11:13 -04:00
2026-08-31 01:29:36 -04:00
2026-08-24 18:38:29 -04:00
2026-08-10 19:28:21 -06:00
2026-08-31 00:39:16 -04:00
2026-07-26 23:09:22 -04:00
2026-08-31 00:53:55 -04:00
2026-07-27 19:39:36 -04:00
2026-08-25 16:53:53 -04:00
2026-08-16 22:56:19 -07:00
2026-08-17 00:57:57 -07:00
2026-08-24 18:29:36 -04:00
2026-08-25 16:53:53 -04:00
2026-06-19 00:16:06 +02:00
2026-08-19 22:48:32 -07:00
2026-08-25 16:53:53 -04:00
2026-08-31 00:05:34 -04:00
2026-07-27 19:39:36 -04:00
2026-07-31 17:41:14 -04:00