open-webui/backend/open_webui
Classic298 073cd65afe
Log upstream provider rejections at warn/error level (#27238)
When an upstream provider rejects a request (e.g. a 400 for a
max_tokens value above the model's ceiling), the actionable error
message was only published to event sinks, which are invisible unless
an event function or webhook is configured. Admins had to query the
provider's API directly to diagnose failures (open-webui#27237).

Add a single log line in publish_model_provider_request_failed — the
chokepoint every upstream failure path (OpenAI-compatible chat,
embeddings, responses, token counting, and Ollama) already routes
through — recording status, provider, url, model, error code, and the
upstream message truncated to 1000 chars. 4xx logs at WARNING, 5xx at
ERROR. Client-facing responses are unchanged, so no additional error
detail is exposed in the chat.


Claude-Session: https://claude.ai/code/session_018VecyiPejru1EVF5yfe2sU

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-23 03:42:48 -04:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal refac 2026-06-29 12:40:20 -05:00
migrations refac 2026-07-23 03:01:01 -04:00
models refac 2026-07-23 02:54:56 -04:00
retrieval chore: format 2026-07-20 22:11:42 -04:00
routers refac 2026-07-23 03:31:32 -04:00
socket refac 2026-07-16 00:30:44 -04:00
static refac 2026-07-20 22:27:13 -04:00
storage refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
tools refac 2026-07-23 03:39:30 -04:00
utils refac 2026-07-23 03:05:29 -04:00
__init__.py refac 2026-06-17 03:01:11 +02:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-07-14 17:34:00 -04:00
constants.py refac 2026-06-29 05:46:51 -05:00
env.py refac 2026-07-09 17:28:05 -05:00
events.py Log upstream provider rejections at warn/error level (#27238) 2026-07-23 03:42:48 -04:00
functions.py refac 2026-07-23 03:39:56 -04:00
main.py chore: format 2026-07-20 22:11:42 -04:00
tasks.py refac 2026-07-16 21:57:43 -04:00