Commit Graph
2230 Commits
Author SHA1 Message Date
Classic298 71de09dba5 fix: a provider error mid-reply no longer keeps the tool loop going (#35237)
When the model provider sent an error in the middle of a streamed reply that had started a tool call, Open WebUI showed the error but kept going. It asked the model for another reply, and a tool call whose arguments were already complete still ran. With a provider that kept failing, every new reply hit the error again, up to the CHAT_RESPONSE_MAX_TOOL_CALL_ITERATIONS limit (1024 by default). Now a provider error ends the reply. The error stays shown, no tool from that reply runs and no further request is sent.

Fixes #35236
2026-11-30 18:33:43 +04:00
Classic298 278342b867 fix: system messages split into several text blocks lose every block after the first (#35153)
A system message sent through the API split into several text blocks, which the OpenAI format allows and clients such as LangChain send, reached the model with only its first block. The rest of the instructions were dropped without any warning. Every block now reaches the model. Text that Open WebUI adds to a system or user message split this way, like knowledge context, used to be copied into every block and is now added once. Requests where every message is a single block of text are sent exactly as before.

Fixes #35149
2026-11-27 17:26:39 +04:00
Classic298 ff70b357e0 fix: file reads by the model get blank lines that are not in the file (#35162)
When the model read or searched files with the built-in file tools, the new paragraph citation markers came with an empty line before each of them, and the text at each paragraph break changed. What the model read no longer matched the file, and the file text alone could go over the read size limit. The markers now go in front of each paragraph and the file text around them stays exactly as it is.

Fixes #35161
2026-11-27 17:26:12 +04:00
G30 0e5eb45c09 fix: keep a reply's text when its model connection drops partway through (#35143) 2026-11-27 17:23:50 +04:00
Timothy Jaeryang Baek 91ef645d95 refac 2026-11-27 15:17:00 +04:00
Timothy Jaeryang Baek 3f3cd7b971 refac 2026-11-27 04:38:15 +04:00
Timothy Jaeryang Baek d36ab208f3 refac 2026-11-27 04:26:53 +04:00
Classic298 78bd95f21e fix: native knowledge citations open PDFs at page 1 instead of the cited page (#35116)
With native function calling and page numbers turned on for sources (page in RAG_SOURCE_METADATA_KEYS), clicking a citation from a search of a knowledge base or of files attached to the chat opened the PDF at the first page, even though the search had found the right page. The citation now opens the PDF at the cited page. Without native function calling it already did.

Fixes #35108
2026-11-27 02:37:45 +04:00
Timothy Jaeryang Baek c456a6dbfd refac 2026-11-26 18:14:38 +04:00
Timothy Jaeryang Baek e0eb2297d1 refac 2026-11-26 16:20:36 +04:00
Timothy Jaeryang Baek 376e77cee0 refac 2026-11-26 15:45:31 +04:00
Classic298 59bd4991e2 perf: faster notification badge and inbox on instances with many chats (#35070)
For regular users, every refresh of the notification badge and every inbox page compared their chat notifications against every chat they could see, and opened the saved copy of every shared chat on the instance to find the ones set to "Allow replies". That cost grew with the size of the instance, to about 70 ms per badge refresh on SQLite and 50 ms on Postgres at 50,000 chats. Now the user's own chats, the chats in their folders and the chats shared with them are looked up separately, and only the saved copies of chats shared with that user get opened. Who sees which notification is unchanged, comment notifications on chats included.

<table>
<tr><th>Regular user, median ms per request</th><th>SQLite before</th><th>SQLite after</th><th>Postgres before</th><th>Postgres after</th></tr>
<tr><td>Badge refresh, 5,000 chats</td><td>15.0</td><td>11.7</td><td>20.8</td><td>17.5</td></tr>
<tr><td>Inbox first page, 5,000 chats</td><td>19.0</td><td>15.1</td><td>27.8</td><td>23.9</td></tr>
<tr><td>Badge refresh, 50,000 chats</td><td>72.1</td><td>23.9</td><td>51.0</td><td>26.2</td></tr>
<tr><td>Inbox first page, 50,000 chats</td><td>78.3</td><td>26.9</td><td>57.3</td><td>31.9</td></tr>
<tr><td>Chat comment mentioning 5 people, 50,000 chats</td><td>312.5</td><td>43.6</td><td>159.3</td><td>88.2</td></tr>
</table>

Fixes #35066
2026-11-25 23:51:53 +04:00
Classic298 4cf955b95c fix: Open WebUI crashes on startup on Windows (#35077)
Since 0.13.5, open-webui serve on Windows stops right away with a FileNotFoundError, because startup creates a folder under /tmp and Windows has no /tmp. That folder now goes under /tmp only where /tmp exists and into the system temp folder otherwise, so Windows starts again. Linux and macOS keep using /tmp, because the local sockets of SSH machine connections need a short path there.

Fixes #35075
2026-11-25 23:51:42 +04:00
Timothy Jaeryang Baek b0d5c67f76 refac 2026-11-25 13:06:56 +04:00
Timothy Jaeryang Baek 91e32f7787 refac 2026-11-25 05:11:32 +04:00
Timothy Jaeryang Baek b6db862ad9 refac 2026-11-25 05:03:58 +04:00
Timothy Jaeryang Baek 4b4ad49a7e refac 2026-11-25 04:57:27 +04:00
Timothy Jaeryang Baek 70fc1ce3f5 refac 2026-11-25 04:55:03 +04:00
Timothy Jaeryang Baek d66d5b7eb0 refac 2026-11-25 04:45:54 +04:00
Timothy Jaeryang Baek 40f5a572ed refac 2026-11-25 04:31:16 +04:00
Classic298 b4c1717ccc fix: machine skills fail the reply on models without the Skills tool (#34974)
On a model with Builtin Tools or the Skills tool switched off, the reply failed at once with the error "name 'machine_skill_prefix' is not defined" whenever a machine skill had to be loaded, and the model was never asked. That covered a skill picked with $ and a machine skill attached to the model, which broke every message on that model. This broke with a recent change on dev. The skill goes into the prompt again and the model answers.

Fixes #34794
2026-11-25 03:00:36 +04:00
Classic298 550da22e63 refac: apply notes availability checks in note chats (#34976)
Note chats now go through the same Notes availability checks as other chats.
2026-11-25 02:59:57 +04:00
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 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 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 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
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