Commit Graph
2177 Commits
Author SHA1 Message Date
Classic298 4eefe65bd4 fix: chats fail when an MCP server from Tether is enabled (#34728)
MCP servers added in Tether have IDs with colons, and Open WebUI puts the server ID in front of every MCP tool name it offers to the model. OpenAI-compatible providers only accept letters, digits, underscores and dashes in tool names, so every chat with such a server turned on was rejected with `Invalid 'tools[0].function.name'`. The same happened for MCP servers whose admin-chosen ID has dots or spaces. Characters outside that set are now replaced with underscores, so these tools reach the model and their calls still go to the right MCP server. Names that were already valid are unchanged.

Fixes #34718
2026-11-23 19:15:19 +04:00
Classic298 9475106560 fix: reply after tools stop can come back empty with some models (#34759)
When a chat hits the tool call limit, or tool use stops because the same call keeps failing or a reply is cut off in the middle of a call, Open WebUI asks the model for one last answer. The instruction to stop and answer was merged into the system prompt at the very top of the conversation, so some models (Gemma 4 on vLLM, for example) kept trying to call tools and returned an empty reply. It is now sent as the last message, after the tool results, so the model reads it right before answering. The start of that last request also stays identical to the earlier ones, so provider prompt caching keeps working for it.

Fixes #34750
2026-11-23 19:11:54 +04:00
Classic298 639e25ae39 perf: stop downloading tool server and terminal specs on every request without Redis (#34856)
Without Redis, every tool list and every chat message that uses an OpenAPI tool server or a terminal downloaded the specs of all of them again and waited for each one, and an unreachable server added its full 10 second timeout every time. The specs loaded at startup and on saving the settings are now reused, the same way they are with Redis, and importing a config now refreshes them too, with or without Redis. A changed spec, or a server that was down at startup while others loaded, appears after saving the settings or a restart as with Redis, and when every server was down at startup each request still tries them again until one loads. In this test a terminal message still takes about 0.9 seconds because it reads the terminal's working directory and system prompt live on every message.

<table>
<tr><th>Servers answering in 300 ms</th><th>Before</th><th>After</th></tr>
<tr><td>Tool list (median of 10)</td><td>312 ms, 10 spec downloads</td><td>11 ms, 0</td></tr>
<tr><td>Chat message with a tool server</td><td>323 ms</td><td>33 ms</td></tr>
<tr><td>Tool list with one tool server unreachable</td><td>10988 ms</td><td>16 ms</td></tr>
<tr><td>Chat message with a terminal (median of 10)</td><td>1842 ms</td><td>934 ms</td></tr>
<tr><td>Chat message with a terminal while another is unreachable</td><td>11961 ms</td><td>932 ms</td></tr>
</table>

Fixes #34855
2026-11-23 19:03:06 +04:00
Classic298 4abf416f96 perf: sidebar folder list no longer reads every attached file in full (#34862)
For regular users, opening the app read every file attached to their folders in full, extracted text included, one by one, only to confirm they could still see it. Files the user uploaded themselves are now confirmed with one small lookup per folder. Files shared by others still get the full access check, so files the user lost access to are still removed from the folder as before. The list and what each folder shows are unchanged.

<table>
<tr><th>30 folders x 8 files of 300 KB, SQLite</th><th>Before</th><th>After</th></tr>
<tr><td>Folder list, typical load</td><td>335 ms</td><td>44-61 ms</td></tr>
<tr><td>Database queries per load</td><td>268</td><td>59</td></tr>
</table>

Fixes #34861
2026-11-23 18:40:20 +04:00
Timothy Jaeryang Baek b7ce1bd194 refac 2026-11-23 18:35:34 +04:00
Classic298 e1e61c48a8 fix: admins get "Model not found" from router models without access settings when the admin bypass is off (#34791)
With BYPASS_ADMIN_ACCESS_CONTROL=false, router models that never got access settings showed up in the admin's model selector, but every chat with them failed with "Model not found". This hit router models set through the ROUTER_MODELS env var or saved through the router models API without access settings, and arena models set through EVALUATION_ARENA_MODELS once the upgrade turns them into router models. Admins can now chat with them, the same way env-set arena models worked before. Regular users still cannot see or use them.

Fixes #34786
2026-11-23 18:34:38 +04:00
Classic298 7ea337921f fix: router model chats get titles, tags and follow-ups from a model the router did not pick (#34895)
With no task model set, the title, tags and follow-ups of a router model chat went through the router again, which matched its rules against the built-in task instructions instead of the conversation. They could come from a model unrelated to the chat, and each one could cost another Decisions API call. They now run on the model the router picked for the reply, as in a direct chat with that model, make no routing call of their own and use the Local or External Task Model by that model's connection. A new router chat is titled once its message is prepared, so a stop or failure before the reply starts can leave it untitled. This covers the automatic tasks after a chat message, and voice chat and manual title generation follow separately.

Fixes #34887
2026-11-23 18:10:11 +04:00
Timothy Jaeryang Baek 464e83e414 refac 2026-11-23 16:21:00 +04:00
Timothy Jaeryang Baek 5697a0939a refac 2026-11-23 16:10:09 +04:00
Timothy Jaeryang Baek 8e548c0f77 refac 2026-11-23 14:20:59 +04:00
Timothy Jaeryang Baek c1f3b6fd1e refac 2026-11-23 03:29:58 +04:00
Timothy Jaeryang Baek e5b098c681 refac 2026-11-22 23:44:38 +04:00
Timothy Jaeryang Baek a78a9663b6 refac 2026-11-22 22:45:57 +04:00
Timothy Jaeryang Baek 657276cf88 refac 2026-11-22 20:47:46 +04:00
Timothy Jaeryang Baek a5058fa562 refac 2026-11-22 20:43:18 +04:00
Timothy Jaeryang Baek 7173e6bd56 refac 2026-11-22 20:33:28 +04:00
Classic298 d065a70483 feat: audit path filters also apply to the OpenAI and Ollama routes (#34665)
AUDIT_EXCLUDED_PATHS and AUDIT_INCLUDED_PATHS only matched paths under /api/ and /api/v1/, so the OpenAI and Ollama routes could not be left out of the audit log, and with an include list set they were never logged. Values are now matched against the path with or without that prefix, so openai or ollama cover those routes.

Part of #33249
2026-11-22 20:29:06 +04:00
Classic298 45f489bea8 fix: chats fail when a Tether OpenAPI tool has the same name as another tool (#34730)
When two tool servers offer a tool with the same name, Open WebUI puts the server ID in front of the second one so the model can tell them apart. Tool servers added in Tether have IDs with colons, so the renamed tool broke the name rules of OpenAI-compatible providers and the provider rejected the whole chat for an invalid tool name. The same happened for admin tool servers whose ID has a dot. Characters outside letters, digits, underscores and dashes are now replaced with underscores in the renamed tool, and calls still reach the right server. Same cause as #34718, which covered MCP servers from Tether.

Fixes #34729
2026-11-22 20:28:37 +04:00
Timothy Jaeryang Baek df6be8c3a1 refac 2026-11-22 17:13:34 +04:00
Timothy Jaeryang Baek 3f54f781be refac 2026-11-22 16:34:32 +04:00
Timothy Jaeryang Baek 9442dca957 refac 2026-11-22 16:29:29 +04:00
Timothy Jaeryang Baek c8aede457d refac 2026-11-22 16:26:59 +04:00
Timothy Jaeryang Baek 37477fe189 refac 2026-11-22 16:18:52 +04:00
Timothy Jaeryang Baek 4ffe27a9d4 refac 2026-11-22 16:08:38 +04:00
Timothy Jaeryang Baek 67863f310c refac 2026-11-22 15:54:36 +04:00
Timothy Jaeryang Baek e72b31f01f refac 2026-11-22 02:51:42 +04:00
Timothy Jaeryang Baek c7c3ad5e78 refac 2026-11-22 02:24:25 +04:00
Timothy Jaeryang Baek f59a3aff85 refac 2026-11-22 02:10:33 +04:00
Timothy Jaeryang Baek 91344e88f7 refac 2026-11-21 23:58:03 +04:00
Timothy Jaeryang Baek e7406ce2f3 refac 2026-11-21 20:04:01 +04:00
Timothy Jaeryang Baek 61b5a267fc refac 2026-11-21 19:27:11 +04:00
Timothy Jaeryang Baek a8e6e5d777 refac 2026-11-21 19:18:19 +04:00
Timothy Jaeryang Baek e8b6f620e8 refac 2026-11-21 16:45:48 +04:00
Timothy Jaeryang Baek c5c42fe3b7 refac 2026-11-21 16:20:44 +04:00
Timothy Jaeryang Baek bc754ef4ec refac 2026-11-20 22:15:12 +04:00
Timothy Jaeryang Baek 7aa18c48fe refac 2026-11-20 21:51:19 +04:00
Timothy Jaeryang Baek 8fb2bf35ad refac 2026-11-19 19:13:33 +04:00
Classic298 3a7291ba7e perf: large chats open faster when context compaction is off (#34671)
Opening a chat loaded the whole conversation a second time to work out how full the model's context is, even with Context Compaction off, which is the default. The server only sends that figure while compaction is on, so with it off every open of a large chat read the conversation twice for nothing. Chats now skip the second read while Context Compaction is off, and nothing changes with it on.

Server time to open a chat with Context Compaction off, fastest of repeated opens:

| Chat size | Postgres before | Postgres after | SQLite before | SQLite after |
|---|---|---|---|---|
| 1 MB | 25 ms | 17 ms | 21 ms | 9 ms |
| 10 MB | 66 ms | 44 ms | 39 ms | 20 ms |
| 50 MB | 337 ms | 184 ms | 119 ms | 71 ms |
| 130 MB | 653 ms | 464 ms | 264 ms | 143 ms |

Fixes #34670
2026-11-18 23:38:50 +04:00
Timothy Jaeryang Baek 43d7281f4e refac 2026-11-18 18:55:30 +04:00
Classic298 47cf51eb78 perf: send tool results to the model as compact JSON (#34640)
Tool results returned as a JSON object or list were re-indented with two spaces before being handed to the model, so those tool calls paid tokens for whitespace nobody reads. They now go to the model as compact JSON. The tool call panel in the chat still shows them pretty-printed, because it formats the result on its own.

Measured on real Open Terminal responses (o200k tokenizer):

| Tool | Before | After | Saved |
|---|---|---|---|
| list_files | 1013 | 672 | 34% |
| glob_search | 2821 | 2061 | 27% |
| grep_search | 2233 | 1652 | 26% |
| run_command | 649 | 614 | 5% |
| read_file | 3254 | 3245 | 0% |

Fixes #34639
2026-11-18 15:47:28 +04:00
Classic298 d8ba9d5538 fix: stopping a long tool-calling reply makes the next message compact too early (#34627)
A stopped reply was saved without the token counts the model had already reported for it, so the next message had to estimate the reply's size from its text. That estimate includes the model's thinking, which is often not sent back to the model, so after a long tool-calling run it could come out far larger than the real context and trigger compaction well before the threshold. A stopped reply now keeps the counts reported so far, marked incomplete, so the size check starts from the real number; text the stopped round produced after its last report is not counted, which is far less than what the old estimate added. Stopped replies now also show their token usage and count toward the analytics token totals, still not as complete responses.

Fixes #34626
2026-11-18 04:56:20 +04:00
Timothy Jaeryang Baek cb19060e8f refac 2026-11-18 01:13:09 +09:00
Timothy Jaeryang Baek 916c03829d chore: format 2026-11-17 22:37:26 +09:00
Timothy Jaeryang Baek 4dad777cdb refac 2026-11-17 22:30:21 +09:00
Timothy Jaeryang Baek 720bb54434 refac 2026-11-17 22:01:25 +09:00
Classic298 e7f02d6825 fix: MCP sign-in fails when the server signs its ID token with the client secret (#34593)
Connecting an MCP server over OAuth 2.1 failed with "Algorithm 'HS256' requires 'oct' key" when the server asked for the openid scope and signed the ID token it returned with the client secret, as Readwise does. Open WebUI tried to check that ID token against the server's published keys, which cannot work for this valid signing method, and threw away the access token it had just received. MCP connections only use the access token, so the sign-in no longer checks the ID token and the connection goes through. SSO login is unchanged.

Fixes #34504
2026-11-17 21:54:17 +09:00
Classic298 4360aeee7f perf: model list loads slowly with Redis when models have large profile images (#34595)
With Redis, every large model profile image makes each load of the model list slower, and Redis holds a full copy of every image, even though the list never shows them (the interface fetches each picture separately). Animated or imported profile images are kept at full size and can be several MB each. Open WebUI now leaves profile images out of the model details it keeps for chats, so Redis no longer holds them and the list loads faster. Functions and Tools now get the model without its profile image.

Measured with 50 custom models, one server process. Each number is the middle value of 5 runs of 60 list loads:

| | before | after |
|---|---|---|
| Redis, 4 images (20 MB as stored) | 64 ms | 45 ms |
| Redis, 12 images (57 MB as stored) | 150 ms | 86 ms |
| No Redis, 4 images | 47 ms | 45 ms |
| Redis memory used by the model list, 4 / 12 images | 24 / 71 MB | 35 KB |

Fixes #34594
2026-11-17 21:53:05 +09:00
Classic298 ab73749ca0 fix: SSO session is lost when the provider has a temporary outage during token refresh (#34585)
When the sign-in provider was unreachable, rate limited or answered with a 5xx while Open WebUI refreshed the user's token, the stored login session was deleted. Tools and connections set to use the user's sign-in token then got no token until the user signed out and back in. Now such failures keep the session and the next tool call refreshes again, while a refresh the provider rejects still removes it, matching the earlier fix for MCP connections.

Fixes #34578
2026-11-17 20:33:00 +09:00
Timothy Jaeryang Baek bf8a8dcc7f refac 2026-11-17 20:28:38 +09:00
Timothy Jaeryang Baek 9a5cd68d20 refac 2026-11-17 19:57:45 +09:00