Commit Graph
6036 Commits
Author SHA1 Message Date
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
Classic298 d3ddbf715c fix: error box stays after Continue Response recovers a failed reply (#34822)
When a reply broke off mid-stream and Continue Response then finished it, the old error stayed under the answer, also after a reload. Continuing now clears the old error as soon as the new attempt starts, on screen and in the saved chat. A continuation that fails again shows and saves its own error, and nothing sent to the model changes.

Fixes #34814
2026-11-23 19:12:45 +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
Classic298 2cfccb1cef fix: users see the default image for a router model shared with them (#34796)
A router model with its own profile image showed the default logo to every user it was shared with or made public for, and only admins saw the uploaded image. The image now follows the same access as the router model itself, so anyone who can see and chat with it in the model selector also sees its image, and users it is not shared with still get the default logo.

Fixes #34793
2026-11-23 18:40:04 +04:00
Timothy Jaeryang Baek c11a16f448 refac 2026-11-23 18:38:47 +04:00
Timothy Jaeryang Baek 1581377b69 refac 2026-11-23 18:38:06 +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 bdebc44c6e fix: knowledge base loses PDF pages when files are added in a batch (#34886)
Adding already processed files to a knowledge base through the batch add API gave the knowledge base a fresh split of each file's plain text. The chunks lost the page they came from and could run across pages, so citations showed no page and RAG_SOURCE_METADATA_KEYS had nothing to pass to the model. The batch add now copies each file's existing chunks and falls back to the file's text when those chunks are missing. The duplicate content check is unchanged.

Fixes #34876
2026-11-23 18:33:12 +04:00
Timothy Jaeryang Baek 74fad78f1c refac 2026-11-23 18:23:07 +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