Commit Graph
6049 Commits
Author SHA1 Message Date
Classic298 414340682e perf: long chats no longer rewrite the whole conversation on every message (#34689)
Every sent message, finished reply, regenerate, edit and saved follow-up rewrote the whole stored conversation, so long chats got slower with each turn, most of all on PostgreSQL. Messages now live only in the message table the app already keeps, and a change writes only the messages it touches. Chats open, share, export and import as before. API responses no longer carry the flat message list older clients saved next to the conversation, and the answers to pinning, archiving, sharing or moving a chat no longer repeat its messages. Existing chats are converted once during the upgrade, in batches that continue where they stopped if the upgrade is interrupted.

| 130 MB chat, instant test model | SQLite before | SQLite after | PostgreSQL before | PostgreSQL after |
| --- | --- | --- | --- | --- |
| Message accepted | 2.4 s | 0.20 s | 10.9 s | 0.32 s |
| Reply done | 4.9 s | 0.9 s | 22.5 s | 1.4 s |
| Regenerate done | 4.6 s | 0.9 s | 19.6 s | 1.4 s |
| Saving an edit | 3.7 s | 1.8 s | 5.8 s | 1.7 s |
| Opening the chat | 2.3 s | 0.9 s | 1.6 s | 1.2 s |
| Written to the database per message | 533 MB | 2 KB | 533 MB | 2 KB |

Fixes #34688
2026-11-25 02:34:37 +04:00
Timothy Jaeryang Baek 3226163dec refac 2026-11-25 02:31:48 +04:00
Timothy Jaeryang Baek 96c12237a8 refac 2026-11-25 02:31:09 +04:00
Timothy Jaeryang Baek bd7d9fbd88 refac 2026-11-25 02:28:35 +04:00
Classic298 5c02632c59 fix: message sent while a reply runs is answered without the chat's attachments (#34935)
A message sent while the previous reply was still running was answered without the files attached earlier in the chat. With Preload files on, the model never got the file's text and the answer showed no citation. With it off, the model was not offered the tools to read the attachments. Answering it also replaced the chat's file list with that message's own files, usually none, so after a reload later messages lost the earlier files too. Such a message now gets the same attachments as a normal follow-up: the chat's files on that branch, minus any the user removed in the meantime, plus its own.

Fixes #34933
2026-11-25 02:18:55 +04:00
Timothy Jaeryang Baek a17581475a refac 2026-11-25 02:15:42 +04:00
Classic298 708e6642a2 perf: page load waits on model providers for users with group default models (#34842)
Members of a group with default models had every page load wait for all model providers to answer before the page was drawn. With an unreachable provider they saw the splash screen for about 11 seconds on each load. The default models are now checked against the model list the server already holds, so the page draws right away and the same default model is selected. The first page load after a server start or a change to the connection settings still waits on the providers once, until the model list has loaded again. A group default that a member can only reach through their own Tether connection no longer counts and they get the global default instead.

<table>
<tr><th>Group member, provider answering in 150 ms unless noted</th><th>before</th><th>after</th></tr>
<tr><td>first request of each page load</td><td>172 ms</td><td>11 ms</td></tr>
<tr><td>provider calls made by it</td><td>1</td><td>0</td></tr>
<tr><td>splash screen gone</td><td>864 ms</td><td>719 ms</td></tr>
<tr><td>splash screen gone, provider not answering</td><td>11.5 s</td><td>0.7 s</td></tr>
</table>

Fixes #34841
2026-11-25 02:04:03 +04:00
Classic298 3904bd6043 fix: OIDC sign-in fails when the provider signs its ID token with the client secret (#34930)
Signing in through an OIDC provider that signs the ID token with HS256 failed with "Algorithm 'HS256' requires 'oct' key", and the user landed back on the sign-in page with an error. OpenID Connect allows this signing method when the app has a client secret, and the key is that secret, which never appears among the provider's published keys. Open WebUI now checks these ID tokens against the client secret, so the sign-in goes through, while a token signed with any other secret is still refused. Providers that sign with their published keys are unchanged.

Fixes #34922
2026-11-25 01:59:02 +04:00
Timothy Jaeryang Baek 352c63be19 refac 2026-11-25 01:53:55 +04:00
Timothy Jaeryang Baek d5553c53e7 refac 2026-11-25 01:48:55 +04:00
Timothy Jaeryang Baek e85500e773 refac 2026-11-25 01:48:46 +04:00
Timothy Jaeryang Baek 8522af2d61 refac 2026-11-25 01:46:31 +04:00
Timothy Jaeryang Baek 8ecc777ee6 refac 2026-11-25 01:35:06 +04:00
Timothy Jaeryang Baek 46ac49fe09 refac 2026-11-25 01:20:55 +04:00
Timothy Jaeryang Baek 22500ecc24 refac 2026-11-25 01:16:55 +04:00
Timothy Jaeryang Baek c37725b7a3 refac 2026-11-25 01:07:47 +04:00
Timothy Jaeryang Baek 8d99689836 refac 2026-11-25 00:18:55 +04:00
Timothy Jaeryang Baek a7896c9140 refac 2026-11-25 00:14:16 +04:00
Classic298 90116cd36f fix: large chats with no machine selected open slowly (#34963)
Opening a chat with no machine selected read through the whole conversation on every open, looking for a machine to restore. That is the normal case for a chat, so large chats opened about 45% slower. A chat that already saved its selection, with no machine or with a machine saved under its former terminal name, now opens without that extra pass. Agent chats with nothing saved still get their machine and folder back.

Fastest of seven opens of a 130 MB chat on SQLite:

<table>
<tr><th></th><th>Context Compaction off</th><th>Context Compaction on</th></tr>
<tr><td>dev before Terminals were renamed to Machines</td><td>0.316 s</td><td>0.429 s</td></tr>
<tr><td>dev</td><td>0.469 s</td><td>0.608 s</td></tr>
<tr><td>this fix</td><td>0.325 s</td><td>0.437 s</td></tr>
</table>

Fixes #34962
2026-11-24 23:11:30 +04:00
G30 c56ba4e759 fix: reject future birth dates in account settings (#34961) 2026-11-24 23:11:24 +04:00
Classic298 179991fc1a fix: saving a router model strips the trailing space from a pattern (#34957)
A pattern like "```|def |function " (the example in the docs) lost its trailing space when the router model was saved, from the dialog or through the API. "function" without a space after it then matched as well, so a message about "functionality" went to the model meant for code. Patterns are now saved exactly as typed, and a pattern saved before this needs its space typed again. Conditions saved through the API now keep their spaces as sent too.

Fixes #34898
2026-11-24 22:51:49 +04:00
Timothy Jaeryang Baek 680cd3a0f3 refac 2026-11-24 22:37:32 +04:00
Timothy Jaeryang Baek 98dc1e5460 refac 2026-11-24 22:30:13 +04:00
Timothy Jaeryang Baek f10d244d05 refac 2026-11-24 22:26:11 +04:00
Timothy Jaeryang Baek 1fbb42be97 refac 2026-11-24 22:11:32 +04:00
Timothy Jaeryang Baek 0f71ee15a1 refac 2026-11-24 20:58:02 +04:00
Timothy Jaeryang Baek 59c8184bf1 refac 2026-11-24 20:53:38 +04:00
Timothy Jaeryang Baek 068fe7a39e refac 2026-11-24 20:49:51 +04:00
Timothy Jaeryang Baek a43c15c7bf refac 2026-11-24 20:37:54 +04:00
Classic298 5d1c7d39d5 fix: system prompt is not prompt-cached on Responses API connections with custom model ids (#34802)
Responses API connections sent the system prompt as a developer message only when the model id looked like a newer OpenAI model. Azure deployments with a custom name and prefixed proxy ids like openai/gpt-6.2 still got it in the separate instructions field, which GPT-6.2 and later never cache, so the whole system prompt was billed at the full input price on every turn and every tool call. The system prompt now always goes out as a developer message in the conversation, which brings the Responses API connection to parity with OpenAI and follows the Open Responses spec. With ENABLE_RESPONSES_API_STATEFUL on, tool calls no longer send the system prompt again, because the provider already keeps that message from the first request.

Fixes #34801
2026-11-24 20:31:33 +04:00
Timothy Jaeryang Baek d22ab1251d refac 2026-11-24 20:24:18 +04:00
Timothy Jaeryang Baek d89cd809cb refac 2026-11-24 20:04:48 +04:00
Timothy Jaeryang Baek 34888d6905 refac 2026-11-24 19:25:20 +04:00
Timothy Jaeryang Baek 1b5af66c4d refac 2026-11-24 19:21:40 +04:00
Classic298 39a4d718a8 feat: audit log names the account on sign-in and sign-up (#34664)
Sign-in and sign-up entries in the audit log had an empty user, so nothing said whose account was involved. A password sign-in, a sign-up that signs the user in and the authenticator code step of two-factor sign-in now name the account in their entry. Failed sign-ins still have no user.

Part of #33249
2026-11-24 19:18:45 +04:00
Classic298 89ecb59a2a feat: audit log records the response status at every level (#34663)
At the METADATA and REQUEST audit levels the entry for each request had an empty response status, so a denied request looked the same as a successful one. The status code is now recorded at every audit level. It carries no request or response content, so the least detailed level can hold it too.

Part of #33249
2026-11-24 19:15:03 +04:00
Timothy Jaeryang Baek 1eb5274f83 refac 2026-11-24 19:10:42 +04:00
Timothy Jaeryang Baek e1855444ae refac 2026-11-24 19:01:44 +04:00
Classic298 810f2ddd8a fix: startup logs an invalid OAuth client error for MCP servers that were never registered (#34938)
An OAuth 2.1 MCP tool server that had not gone through Register Client yet logged "Stored OAuth client data is invalid; reconnect this tool server" on every startup, even though nothing was stored. Such a server is now skipped at startup, the same way it is skipped when a user connects, so the log stays quiet until it is registered. Client data that cannot be read, for example after the encryption key changed, is still reported.

Relates to #34937
2026-11-24 18:45:22 +04:00
Timothy Jaeryang Baek 57c955a033 refac 2026-11-24 16:39:36 +04:00
G30 9ab9c59a5f fix: complete local machine installation under uvloop (#34916) 2026-11-24 15:57:55 +04:00
Timothy Jaeryang Baek f4a12bbc7f refac 2026-11-23 22:16:20 +04:00
Classic298 b21b90533e fix: chat search with View set to All takes minutes when many chats are shared (#34911)
Searching chats in the search dialog with View set to All went through every shared chat on the instance before checking whether the searcher may open it. On PostgreSQL it also read through the messages of all users' chats, only to drop the ones the searcher cannot open, so one search could run for minutes while holding database connections. Now the folders and shared chats the searcher can open are looked up first and only those are searched, which also speeds up Created by you. The results are the same as before, and a user who owns nearly every chat keeps today's speed.

Measured on PostgreSQL with 61,000 chats (640,000 messages) and 1,000 shared chats (410 MB), for one user who can open 1,400 chats and 300 shared chats and one who can open 7,500 chats and 400 shared chats.

<table>
<tr><th>search</th><th>1,400 chats before</th><th>after</th><th>7,500 chats before</th><th>after</th></tr>
<tr><td>All, empty</td><td>1.2 s</td><td>0.2 s</td><td>2.3 s</td><td>0.3 s</td></tr>
<tr><td>All, a common word</td><td>10.8 s</td><td>1.0 s</td><td>12.5 s</td><td>7.6 s</td></tr>
<tr><td>All, two words</td><td>18.2 s</td><td>1.4 s</td><td>20.8 s</td><td>14.3 s</td></tr>
<tr><td>All, a rare word</td><td>14.5 s</td><td>2.4 s</td><td>15 s</td><td>8.9 s</td></tr>
<tr><td>Created by you, a common word</td><td>0.04 s</td><td>0.04 s</td><td>7.0 s</td><td>0.15 s</td></tr>
<tr><td>Created by you, 14 words</td><td>1.6 s</td><td>0.19 s</td><td>3.9 s</td><td>1.8 s</td></tr>
</table>

Fixes #34903
2026-11-23 21:56:08 +04:00
Classic298 6299625426 fix: Visualizations tool accepts a Chart.js chart that did not ask for the library (#34912)
When a model drew a chart with Chart.js through the Visualizations tool but left out libraries=["chartjs"], the tool still told it the chart was accepted. The chart then failed in the chat with "Chart is not defined", and the model never found out, so it moved on as if the chart had worked. Such a call is now refused with a short error that tells the model to ask for the library, so it can retry and the user gets a working chart in the same reply. Charts that ask for the library are accepted as before, and so are visuals that only show Chart.js code or mention it in their text.

Fixes #34909
2026-11-23 21:55:58 +04:00
Classic298 c35321f9a4 fix: every page reload fires a user updated event even when nothing changed (#34838)
Every page load sends the browser's timezone, and the server saved it and fired a user updated event each time, even when it was the timezone already stored. Webhooks and Event functions listening for that event got one per reload for every user. Now the timezone is only saved, and the event only fired, when it actually changes.

Fixes #34837
2026-11-23 20:14:12 +04:00
Classic298 765465eed1 fix: video generation without a first frame fails on servers that need multipart (#34681)
Text-only video requests reached OpenAI compatible servers form-urlencoded, so servers that only accept multipart for the create request could not read them and answered with a 400. They now go out as multipart, like requests with a first-frame image.

Fixes #34679
2026-11-23 20:13:37 +04:00
Classic298 6f0a52c1de perf: start up without waiting for tool and terminal servers to answer (#34866)
Open WebUI stayed offline at startup until every configured tool server and terminal server had answered or timed out, one after the other, so a single unreachable server kept the app and its health check down for over 20 seconds. Startup now kicks off that fetch in the background and starts serving right away. Anything that needs the tool server details before the fetch lands loads them on demand, as it already did when nothing was cached. If an admin saves the tool or terminal server settings while the startup fetch is still waiting on an unreachable server, the startup fetch can finish last and put back the old list until the next save.

<table>
<tr><th>Startup time (until the app answers)</th><th>Before</th><th>After</th></tr>
<tr><td>Tool and terminal server unreachable</td><td>23.0 s</td><td>0.6 s</td></tr>
<tr><td>Tool and terminal server answering in 300 ms</td><td>1.35 s</td><td>0.6 s</td></tr>
</table>

Fixes #34865
2026-11-23 20:12:02 +04:00
Classic298 5e61d4ef03 fix: router model titles and tags in a voice call come from a model unrelated to the chat (#34908)
A realtime voice call in a router model chat asks for the title and tags at its first spoken words, before any model has answered. With no task model set, those requests went to the router, and its rules and Decisions API judged the built-in task instructions, so a model unrelated to the chat wrote the title and tags. Prompt Autocompletion, Display Emoji in Call and Merge Responses had the same problem, and the emoji instructions by themselves match a rule that looks for code blocks. Each of these requests is now routed like a message holding the text it is about (the chat, the text being typed for autocompletion, the spoken sentence for the emoji, the question and answers for a merge). A task model set in the admin settings still writes them as before.

Refs #34887
2026-11-23 20:11:46 +04:00
Timothy Jaeryang Baek 9c71742e35 refac 2026-11-23 19:37:40 +04:00
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