mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-02 03:59:45 +02:00
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>