Commit Graph
2195 Commits
Author SHA1 Message Date
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
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 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
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 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 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