Commit Graph
1985 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 9d1b4ef362 refac 2026-10-30 16:01:47 +09:00
Timothy Jaeryang Baek 0e0ba872a4 refac 2026-10-30 07:50:55 +09:00
Timothy Jaeryang Baek 858c1e9665 chore: bump 2026-10-29 17:47:24 +09:00
Timothy Jaeryang Baek df61370456 refac 2026-10-29 17:20:55 +09:00
Timothy Jaeryang Baek ef29fb12f1 refac 2026-10-29 16:44:26 +09:00
Timothy Jaeryang Baek f2cdbbebe3 refac 2026-10-29 16:39:42 +09:00
Classic298andGitHub 63ca4237eb feat: keep tool images away from models with Vision turned off (#33345)
When a tool returned an image, for example Open Terminal reading a PNG, a native tool or an MCP screenshot tool, the image was sent to the model even when the model has Vision turned off. A provider serving a text-only model rejects that request, so the reply failed with an error like "At most 0 image(s) may be provided in one prompt", and every later message in the chat failed the same way. With Vision off the model now gets a short "[image]" note in place of each tool image, including images already saved in the chat, so stuck chats work again. The images stay saved, so they reach the model again once Vision is turned on.

Fixes #32720
2026-10-29 16:24:47 +09:00
Classic298andGitHub cfe745b00c feat: show ComfyUI images saved by the Save Animated WEBP and Save Animated PNG nodes (#33325)
A ComfyUI workflow that ends in the core Save Animated WEBP or Save Animated PNG node finished on the ComfyUI side, but nothing showed up in the chat, because Open WebUI only picked up images from the Save Image, Save Image (Advanced) and Preview Image nodes. Images from both animated nodes now show up in the chat too, as the original animated file, for image generation and image editing.

Closes #33013
2026-10-29 05:24:46 +09:00
Classic298andGitHub 76b7be67fc feat: let admins exclude routes like health checks from OpenTelemetry metrics (#33329)
With OpenTelemetry metrics on, every request is counted in the HTTP request and duration metrics, so Kubernetes liveness and readiness probes on `/health` and `/health/db` fill the time series database and dashboards with noise. These metrics now skip any request whose URL matches `OTEL_PYTHON_FASTAPI_EXCLUDED_URLS` (or `OTEL_PYTHON_EXCLUDED_URLS` as a fallback), the standard OpenTelemetry variable that traces already honour. It takes a comma-separated list of regular expressions such as `/health,/_app/immutable/.*`, each matched anywhere in the URL, so `/health` also covers `/health/db`. One pattern now drops the same requests from traces and metrics alike. Nothing changes when the variable is unset.

Closes #31609
2026-10-29 05:21:06 +09:00
Classic298andGitHub e49ff5df64 feat: notify automation owners when a run fails (#33331)
When a scheduled automation failed (for example because its model was deleted), the owner could only see it as an error in the run history, so they found out much later when the results stopped showing up. Automation run failed is now one of the automatic events users can pick for their notification targets under Settings > Notifications, and every failed run, scheduled or started by hand, sends the automation name and the error to those targets. In Admin Settings > General > Events, webhooks set to Specific users or groups now receive these failures when the owner is among those users or groups, and webhooks set to System events only stop receiving them.

Closes #33228
2026-10-29 05:20:40 +09:00
G30andGitHub 77398eba31 fix: a new notification target becomes the default after the last one was removed (#33284) 2026-10-29 02:58:45 +09:00
G30andGitHub 0ac55c8e72 fix: a removed webhook carried over from before v0.11 stays removed (#33295) 2026-10-29 02:22:02 +09:00
Classic298andGitHub 2c64ab5487 fix: chat stops with no answer when an MCP server request fails mid-chat (#33272)
When an MCP tool server could not be reached for a tool call (server restarted, connection reset by a proxy or load balancer, a request timing out), the whole chat was cancelled as if the user had pressed stop, and the log only said "Task was cancelled!". Now only that tool call fails, the model gets the connection error as the tool result and the reply finishes, and the underlying connection error is logged. The MCP SDK cancels whatever task opened the session when a single request fails, so each MCP session now runs in its own task instead of the chat's.

Fixes #33268
2026-10-28 10:19:33 +09:00
Timothy Jaeryang Baek b34885efc6 refac 2026-10-28 10:02:45 +09:00
Timothy Jaeryang Baek ab133dba21 refac 2026-10-28 08:04:47 +09:00
Classic298andGitHub a4247cfde9 refac: refuse a compressed body when fetching a remote URL (#33271)
Remote fetches now ask for an uncompressed response: web pages, documents, remote images, profile pictures from a login provider and webhook deliveries. A response that comes back compressed anyway is refused, except for a webhook reply, which is only logged and is left unread instead.

A page or file whose host echoes a stored `Content-Encoding` regardless of what the client asks for (an S3 or MinIO object uploaded with that metadata) is no longer read, and a profile picture that arrives that way falls back to the default avatar.
2026-10-28 06:27:00 +09:00
Classic298andGitHub e77204559b fix: foreground sub-agent loses its partial output at the tool-call limit (#33269)
When a foreground sub-agent stopped at the tool-call limit, the parent model got only the error, so everything the sub-agent had written before the limit was lost, while a background sub-agent in the same state reported it as partial output. A foreground sub-agent now returns the error followed by its partial output, the same way the background report does. The error in both modes is now the plain message, such as "Tool-call limit reached (30 iterations).", instead of raw internal data around it.

Fixes #33267
2026-10-28 06:26:35 +09:00
Classic298andGitHub 7a76e9fed6 fix: sub-agents cannot be given a photo attached in the chat (#33244)
When the model handed a photo from the chat to a sub-agent, the call failed with "file_ids not attached or unavailable" and no sub-agent started. Text files and documents worked, only photos were refused. Photos attached in the chat are now accepted and reach the sub-agent as an image, the same way they reach the model in a normal chat. Files that were never attached to the chat are still refused.

Fixes #33241
2026-10-28 02:21:27 +09:00
G30andGitHub d1ae9e75e0 fix: a failed ComfyUI run is reported as a successful image generation with no images (#33237) 2026-10-28 02:21:01 +09:00
Timothy Jaeryang Baek 83437197e3 refac 2026-10-27 09:10:12 +09:00
Timothy Jaeryang Baek b420726ff1 refac 2026-10-27 08:41:51 +09:00
Classic298andGitHub 302b8cfd50 fix: tool calls make chats compact too early and inflate prompt token counts (#33218)
Since a recent refactor on dev, the prompt and completion token counts of a reply that used tools added up every model call in the loop, even though each later call already re-sends the whole conversation. A reply whose context was 50k tokens showed 90k, the context gauge read over 100% and the next message triggered compaction long before the chat reached the threshold. Prompt and completion tokens show the latest call again, while total tokens and cost still add up across all calls.
2026-10-26 19:17:34 +09:00
Timothy Jaeryang Baek 7b303cf496 refac 2026-10-26 07:24:36 +09:00
Timothy Jaeryang Baek 5f95008abd refac 2026-10-25 14:20:56 +09:00
Timothy Jaeryang Baek f21eadbc1a refac 2026-10-25 08:33:40 +09:00
Timothy Jaeryang Baek 52e155019f refac 2026-10-25 08:24:14 +09:00
Classic298andGitHub c69e5a73c0 fix: "More Concise" and "Add Details" now revise the reply instead of answering the instruction (#33084)
Choosing Add Details, More Concise, or typing a suggestion under a reply sent the model your original question followed straight by the bare instruction, with the reply itself missing, so it answered the instruction on its own (for example "OK, I'll keep answers shorter") instead of rewriting that reply. The model now receives the reply it is being asked to change, so it returns a shorter, more detailed or altered version of it. Plain Try Again and temporary chats were not affected.

Fixes #33083
2026-10-25 08:07:21 +09:00
Classic298andGitHub f3f9af594f fix: MCP tools whose input has alternative forms are called with no arguments (#32903)
* fix: MCP tools that list their arguments under anyOf are called with no arguments

When an MCP tool described its input as alternatives, for example a page by id or by path and locale, and had no top-level list of fields, every argument the model sent was dropped and the tool was called with nothing, so the server rejected the call. Arguments for MCP tools now reach the server as the model sent them, and the MCP server checks them against its own schema. Other tool types still keep only the arguments their schema lists.

Fixes #32898

* refac: shorten the MCP arguments comment

The comment now only says why MCP tools skip the argument filter.
2026-10-25 06:22:08 +09:00
Classic298andGitHub 37af63b649 fix: models get an unreadable dump instead of the MCP server's error message (#32942)
* fix: MCP tool errors reach the model as a Python list dump instead of the server's message

When an MCP tool server answered a call with an error, the model got a Python dump of the whole result list, with quotes, annotations and meta fields, instead of the error text the server wrote. Line breaks in the message were escaped as well, so a validation error listing the missing argument was hard to read and models tended to retry the same broken call. The model now gets the server's error text as written, the same way successful results already arrive.

Fixes #32918

* refac: drop the fallback text for MCP errors with no message

The error now carries only the text the server sent.

* fix: keep a readable error when an MCP error has no text

MCP error results that only carry images, audio or resources now give the model a short error message instead of an empty one.
2026-10-25 06:21:30 +09:00
Classic298andGitHub ee7c9ff5c1 fix: tool server tools change their schema on every restart and break prompt caching (#33000)
The required parameters of OpenAPI tool server tools, Open Terminal included, were sent to the model in a random order that could change every time Open WebUI restarted. The tool list sits at the start of every prompt, so a different order made every prefix cache on the model side miss, and long chats were processed again from scratch after a restart. The required parameters now keep the order the tool server declares, so the tool list stays identical across restarts.
2026-10-25 04:46:48 +09:00
8151826483 feat: connect to MCP servers that speak protocol version 2026-07-28 (#33087)
Upgrade the MCP SDK to 2.3.0 and build MCPClient on its Client in
mode='auto', which probes server/discover for the stateless 2026-07-28
protocol and falls back to the initialize handshake for legacy servers.
MCPClient's public surface is unchanged.

MCP_INITIALIZE_TIMEOUT becomes the session's default request timeout, so
it bounds the legacy handshake, tool listing and resource reads; tool
calls keep using AIOHTTP_CLIENT_TIMEOUT_TOOL_SERVER.

Relates to #29778

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 04:41:10 +09:00
Timothy Jaeryang Baek 2262073146 refac 2026-10-24 04:50:12 +09:00
Timothy Jaeryang Baek c9415a688e refac 2026-10-22 07:40:01 +09:00
Classic298andGitHub 6367a3cc40 fix: OAuth connections send no token when the user calls the API (#32826)
A model connection with its auth type set to OAuth only forwarded the user's sign-in token for requests coming from the browser. The same user calling the API with their bearer token or an API key sent nothing upstream, so an SSO-protected model server rejected every API call and its models could not be listed or used. These connections now fall back to the user's latest sign-in session the same way tool servers already do.

Fixes #32820
2026-10-22 02:13:50 +09:00
Classic298andGitHub 21f770fb73 fix: OAuth 2.1 (Static) MCP connections send no client secret to servers like X Ads (#32818)
With OAuth 2.1 (Static), when the authorization server did not accept the client secret as a form field, Open WebUI used whichever auth method the server's metadata listed first. X Ads lists "none" (public client, no secret) first, so the token exchange went out without the configured client secret and X rejected it with "Missing valid authorization header". When the server supports HTTP Basic auth, the secret is now sent that way, no matter which method it lists first.

Fixes #32813
2026-10-21 16:38:34 +09:00
Timothy Jaeryang Baek d5cd7f4907 refac 2026-10-21 09:26:26 +09:00
Classic298andGitHub 56eca192ab feat: context compaction now runs on chats with few messages that are over the threshold (#32794)
Context compaction summarizes older messages and keeps the most recent ones verbatim, splitting the chat at a user message. It skipped the chat whenever the first follow-up message sat too close to the end to keep the share set in the Retained Messages admin setting. So a fresh chat with one question and one reply carrying a lot of tool output never compacted: the follow-up failed with a context length error, and regenerating or editing that follow-up failed the same way. Now compaction splits at the first follow-up message in that case, keeping fewer messages than Retained Messages asks for, so the chat keeps working. Chats where a split already met that share compact as before, and compaction between tool calls is unchanged.

Fixes #32781
2026-10-21 08:35:13 +09:00
Classic298andGitHub 217766ed0f fix: MCP list results from FastMCP servers reach the model twice (#32726)
When a tool on a server built with the standalone FastMCP package returned a list, the model got the list twice, once as plain text and once as structured data, so every list result cost two to three times the tokens. That package sends the whole list as a single piece of text, a format Open WebUI did not recognise as a duplicate. The list now reaches the model once, and structured data that the text does not already contain is still passed along.

Fixes #32719
2026-10-21 04:46:02 +09:00
Classic298andGitHub 794e57cf7e fix: misleading ask_user error when questions are not sent as a list (#32727)
When a model sent the ask_user questions as anything other than a list, for example a JSON-encoded string, the tool answered "ask_user requires 1-3 questions." The model had sent the right number of questions, so it did not understand the error and often repeated the same call in a loop. It now gets a separate error saying the questions must be an array of question objects, and the count error only appears when the count is actually wrong.

Fixes #32662
2026-10-21 03:33:10 +09:00
G30andGitHub ab6976b5bf fix: when two tools have a function with the same name, the model can call both (#32670) 2026-10-21 02:25:31 +09:00
G30andGitHub fd1e59b25f fix: an array query parameter reaches an OpenAPI tool server as repeated values (#32677) 2026-10-21 02:18:13 +09:00
Timothy Jaeryang Baek 079fb19e75 refac 2026-10-16 18:58:58 +04:00
Timothy Jaeryang Baek 5cf7c03332 refac 2026-10-16 14:35:09 +04:00
Timothy Jaeryang Baek 92e64c1d59 refac 2026-10-16 14:31:39 +04:00
Classic298andGitHub 51a4d58270 feat: tools come back on their own after all OpenAPI tool servers were unreachable (#32533)
With Redis, if every tool server was unreachable when Open WebUI loaded the tool server list, it cached an empty list and served it forever. The tools stayed missing from chats and the tool list after the servers came back, until a restart, a save in the tool server settings or a manual delete of the cached Redis key. An empty cached list is now only trusted while no OpenAPI tool server is enabled, so the next request that loads tools fetches the servers again, the same way terminal servers already behave. While an enabled server stays unreachable, each such request tries it again and can wait for its timeout.

Fixes #29573
2026-10-16 14:10:33 +04:00
Classic298andGitHub 3ccea416b4 fix: built-in tools disappear when a model has a custom tools parameter (#32530)
Adding a custom parameter named tools to a model, for example to turn on a provider's native web search, made Open WebUI drop all of its own tools for that model: notes, knowledge, tasks and any tools attached to the model stopped working, and attached files lost their context. Those tools now stay, and the model's custom tools are sent alongside them. API calls that pass their own tools, or an empty list to turn tools off, behave as before.

Fixes #32528
2026-10-16 14:09:32 +04:00
Timothy Jaeryang BaekandClassic298 f5a26f53a0 refac
Co-Authored-By: Classic298 <27028174+Classic298@users.noreply.github.com>
2026-10-16 04:20:53 +04:00
Timothy Jaeryang Baek 597b00a547 refac 2026-10-16 03:17:14 +04:00
Classic298andGitHub ae6793dd4f fix: OAuth token refresh ignores the client_secret_basic auth method (#32507)
When Open WebUI authenticates to the OAuth provider with client_secret_basic, either because OAUTH_TOKEN_ENDPOINT_AUTH_METHOD is set to it or because an MCP tool server's OAuth provider only offers that method, sign-in sent the client ID and secret in an HTTP Basic header but the token refresh always put them in the request body. Providers that only accept Basic rejected every refresh with invalid_client, so once the access token expired Open WebUI deleted the user's saved OAuth tokens, and model connections and tool servers set to forward the user's OAuth token stopped working until the user signed in again. The refresh now authenticates the same way sign-in does for client_secret_basic, with the credentials only in the Basic header. Setups using client_secret_post, or leaving the setting unset, still send the credentials in the request body exactly as before.

Fixes #32506
2026-10-16 03:01:35 +04:00
Timothy Jaeryang Baek 0b3812f285 refac 2026-10-15 17:56:56 +04:00