Commit Graph
2166 Commits
Author SHA1 Message Date
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
Classic298 00bd84944d fix: log a warning when an OAuth session is deleted (#34583)
Signing in past OAUTH_MAX_SESSIONS_PER_USER prunes a user's oldest stored OAuth sessions, a back-channel logout from the identity provider ends all of them, and connecting an MCP server again replaces the old session for that server. Pruning and the reconnect logged nothing, and the provider logout logged one info line per user without saying which sessions it removed, so an admin could not trace why a user's provider login was gone. Each of these deletions now logs a warning with the user, the session ID and the reason, the same way a failed token refresh already does.

Fixes #34580
2026-11-17 19:32:55 +09:00
Classic298 f3660788ab fix: OAuth session limit drops a device still in use after sign-outs elsewhere (#34586)
Signing out left the browser's stored OAuth session in place, and once a person reached OAUTH_MAX_SESSIONS_PER_USER the next sign-in removed the sessions created first. A device signed in early and still in use lost its session to ones from browsers that had already signed out. Signing out now removes that browser's stored session when the person still has another one for the same provider, and the limit removes the sessions that were signed in or refreshed least recently. A person's only session stays after sign-out, because automations and API key calls keep using it.

Fixes #34581
2026-11-17 19:32:44 +09:00
Timothy Jaeryang Baek c201472cf8 refac 2026-11-17 19:31:57 +09:00
Timothy Jaeryang Baek 3349606652 refac 2026-11-17 19:13:47 +09:00
Timothy Jaeryang Baek e1d2722520 refac 2026-11-17 18:48:38 +09:00
Classic298 139ca26f93 fix: a tool call that runs past the tool server timeout reaches the model as an empty error (#34119)
When a terminal command or a tool server call took longer than the tool server timeout (AIOHTTP_CLIENT_TIMEOUT_TOOL_SERVER), the model got `{"error": ""}` back as the tool result, with nothing saying what went wrong. It now gets `{"error": "TimeoutError"}`, which is also what Open WebUI already reports when reading a tool server's list of tools times out, so the model can tell the user that the call timed out.

Fixes #34096
2026-11-17 01:28:40 +09:00
Classic298 a18774d2b8 fix: MCP servers with a tool list or tool result over 1 MB stop working (#34421)
* fix: MCP servers with a tool list or tool result over 1 MB stop working

Since the MCP library update in 0.12.4, an MCP server that answers with a tool list or a single tool result larger than 1 MB fails with "Failed to connect to MCP server", or the tool call fails. The server answers fine; the library rejects any streamed message over 1 MB, and a server that streams its whole tool list in one message hits that as soon as it offers enough tools. Those messages are accepted again at any size, the way they were before the update and the way plain JSON answers from the same servers already are.

Fixes #34201

* Lift the same limit for MCP servers reached through Tether
2026-11-17 01:26:29 +09:00
Classic298 be7290a09b fix: images attached in an agent chat never reach the agent (#33993)
Attaching an image in a chat with a coding agent model (Claude Code, Codex and the others) dropped the image silently, so the agent only saw the text of the message. The image is now sent to the agent together with the message, as it already is for normal chats. Reported in #33991.
2026-11-17 01:22:54 +09:00
Timothy Jaeryang Baek 7e5c7c02b9 refac 2026-11-17 01:01:23 +09:00
Timothy Jaeryang Baek 6695423f2c fix: chat goes back to an older summary after a compaction during a tool run
Fixes #34140
2026-11-17 01:01:02 +09:00
Timothy Jaeryang Baek 8d7a8dbe54 refac 2026-11-17 00:47:42 +09:00