Commit Graph
6096 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 9c9a3ca0d6 refac 2026-11-26 01:31:48 +04:00
Timothy Jaeryang Baek 9a596e2eed refac 2026-11-26 00:47:50 +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
Classic298 7e5634d208 fix: attaching a file without pandoc sometimes shows a raw error instead of "Pandoc is not installed" (#35065)
On a server without pandoc, attaching a file that needs it could show the raw library error, which tells the user to install pandoc themselves, instead of "Pandoc is not installed on the server". The raw error was saved first and replaced with the friendly message a moment later, and the chat often picked up the raw one in between. The friendly message is now saved right away, so the warning toast always shows it.

Fixes #35064
2026-11-25 13:27:53 +04:00
Timothy Jaeryang Baek efcbd9c6d7 refac 2026-11-25 13:21:47 +04:00
Timothy Jaeryang Baek 1c2c3e794e refac 2026-11-25 13:16:37 +04:00
Classic298 18b9b449c7 fix: deleting a note leaves its chat counted in admin analytics (#35059)
Deleting a note, on its own or with the folder holding it, removed the note but kept the conversation from its chat panel. Admin analytics went on counting its messages and tokens, listed it as a session and showed its messages. Deleting a note now deletes its chats too, for everyone who chatted with it.

Fixes #35057
2026-11-25 13:13:28 +04:00
Classic298 cdf38c4a72 fix: deleting a folder or all chats leaves their replies and sub-agents running (#35058)
Deleting a single chat stops a reply that is still being written and any sub-agent it handed work to. Deleting a folder with its chats, or all chats, removed the chats but left that work running, so replies kept streaming from the provider and a sub-agent left running kept its background slot, refusing the next delegation with "Async subagent capacity reached". Both now stop the running work of every chat they delete, including its sub-agents, as deleting a single chat does.

Fixes #35056
2026-11-25 13:13:17 +04:00
Classic298 1fcfc8a5cd fix: deleting a folder with its chats leaves their sub-agent and timer conversations behind (#35055)
When a chat in a folder had handed work to a sub-agent or set a timer, deleting the folder with its contents removed the chat but kept the conversation that sub-agent or timer ran in. Admin analytics went on counting its messages and tokens, listed it as a session and returned its text. Deleting the folder now removes the stored conversations along with their chats, the same way deleting a single chat or all chats already removes them.

Fixes #35053
2026-11-25 13:13:06 +04:00
Timothy Jaeryang Baek b0d5c67f76 refac 2026-11-25 13:06:56 +04:00
Classic298 893584700a fix: upgrade looks stuck while it moves chat messages (#35054)
During a database upgrade the log only named the step that was running, and the progress lines of long steps never showed, whatever GLOBAL_LOG_LEVEL was set to. On a big install an admin saw `Running upgrade d2f86c0b41ae -> 5e7a2c9d4b13` and then nothing for minutes while the chat messages were moved, which looks like a hung upgrade and invites a restart in the middle of it. The database upgrade steps now log at the level set in GLOBAL_LOG_LEVEL, so with the default the running count of moved chats shows while the step works.

Fixes #35052
2026-11-25 12:47:34 +04:00
Classic298 f7d437324d fix: deleting one listed vector store removes the whole connection (#35043)
With "List stores as knowledge bases" on, an admin sees Delete on each store in Workspace > Knowledge. Deleting one store reported success but removed the entire connection, so every store of it disappeared for every user, and models lost the store they had attached. These stores live on the endpoint and are read-only, so deleting one is now refused with the read-only error and the connection, its stores and the models stay as they were.

Fixes #35042
2026-11-25 12:39:25 +04:00
Classic298 4ca96cffc8 fix: deleting a chat while its background sub-agent runs leaves the chat in place on Postgres (#35035)
On Postgres with Redis, deleting a chat whose background sub-agent was still working often failed without an error. The sub-agent stopped and its thread went away, but the chat stayed in the sidebar. Stopping the sub-agent makes it post its result into that same chat, and that write and the delete blocked each other until the database cancelled one of them, usually the delete. Deleting a chat now locks the chat first, like every other write to a chat, so the two run one after the other. Deleting all chats or a folder's chats could clash the same way and gets the same change.

Fixes #35034
2026-11-25 05:15:01 +04:00
Timothy Jaeryang Baek aceed36114 refac 2026-11-25 05:14:02 +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
Classic298 6123360666 fix: admins can read sub-agent chats with ENABLE_ADMIN_CHAT_ACCESS off (#35031)
With ENABLE_ADMIN_CHAT_ACCESS turned off, admins could still open another user's sub-agent, timer and note chats by id. Those chats hold the same conversation content as the parent chat, so they now follow the same setting as every other chat.
2026-11-25 05:00:26 +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 dfdf060d81 fix: opening a note saves it again without any edit (#35017)
Opening or leaving a note saved its text to the server even when nothing in it was touched. Its updated time went up, so reopening a folder that still had notes open in its tabs reordered the folder's newest-first Notes list by load order instead of last edit. Opening or leaving a note without editing it no longer saves its text, and edits still save as before.

Fixes #35003
2026-11-25 03:54:33 +04:00
Classic298 460bf0e42b fix: database upgrade breaks the reply chain of old chats whose first message has no id (#35012)
In a chat from an older version whose saved message list is broken, the upgrade falls back to the older plain list of its messages. When that list's first entry has no id but is already saved, the message after it kept pointing at a first message that does not exist, so the conversation could not be followed back to its start. The next message now points at the saved first message.

Fixes #35004
2026-11-25 03:45:53 +04:00
Timothy Jaeryang Baek 2801ee9ea4 refac 2026-11-25 03:40:41 +04:00
Classic298 d8c500a8d2 fix: questions and imported replies show as not done in the admin message analytics (#35010)
Since chats are stored message by message, the admin message analytics and a session's message list return `done: null` for every question and for imported replies that never said whether they finished, where they used to return `true`. They return `true` again, and only a reply that is still running reads as not done.

Fixes #35008
2026-11-25 03:40:02 +04:00
Classic298 5cfbbc3d09 fix: saving a chat without a reply's usage, output or error wipes them (#35009)
A chat save from an API client or an older tab that leaves out a reply's usage, output or error wiped them from the stored reply, so the admin analytics lost the reply's tokens and its failed status. A save now leaves the reply's fields it does not send as they were, usage, output and error included, the way the analytics kept them before chats were stored message by message, and the reopened reply keeps its tool output as well. Sending a field as empty clears it.

Fixes #35007
2026-11-25 03:39:48 +04:00
Classic298 991bb4609f fix: exporting chats, the archived chats list and Unarchive All slow down with many chats (#35005)
Since #34689 stored every message on its own, every action that loads many chats with their messages read them one chat at a time, so exporting chats, a folder's export, the admin's All Chats export and the archived chats list got several times slower, growing with the number of chats. The messages of the listed chats now come in one read per 500 chats. Unarchive All only needs to know which chats are archived and no longer loads any messages.

<table>
<tr><th>1000 chats, 10 messages each</th><th>SQLite before #34689</th><th>SQLite now</th><th>SQLite fix</th><th>PostgreSQL before #34689</th><th>PostgreSQL now</th><th>PostgreSQL fix</th></tr>
<tr><td>Export Chats</td><td>0.26 s</td><td>1.00 s</td><td>0.58 s</td><td>0.27 s</td><td>1.82 s</td><td>0.46 s</td></tr>
<tr><td>Folder export</td><td>0.21 s</td><td>1.86 s</td><td>0.51 s</td><td>0.19 s</td><td>1.09 s</td><td>0.42 s</td></tr>
<tr><td>Archived chats list</td><td>0.25 s</td><td>1.08 s</td><td>0.57 s</td><td>0.21 s</td><td>1.11 s</td><td>0.40 s</td></tr>
<tr><td>Unarchive All</td><td>0.07 s</td><td>1.13 s</td><td>0.02 s</td><td>0.13 s</td><td>0.94 s</td><td>0.05 s</td></tr>
<tr><td>Admin All Chats export</td><td>0.14 s</td><td>1.96 s</td><td>0.79 s</td><td>0.33 s</td><td>1.45 s</td><td>0.59 s</td></tr>
</table>

Fixes #35001
2026-11-25 03:39:28 +04:00
Classic298 af31059d16 fix: shared chat shows a sub-agent's report as raw text from the owner (#35011)
Someone reading a shared chat saw each sub-agent report, timer and message from another chat as a plain message from the chat's owner, showing the full machine-written report, where the owner sees a compact row such as "Sub-agent finished". A shared chat hides the private details of messages the reader did not write, and that also hid which kind of row each of these messages is. The reader now gets that kind and nothing else, so they see the same rows as the owner, and the same goes for a copy the reader makes of the shared chat.

Fixes #34998
2026-11-25 03:39:25 +04:00
Classic298 b87c99f44f fix: database upgrade deletes the messages of chats with a broken message list (#34995)
The database upgrade that moves chat messages out of the chat record deleted every message of a chat whose saved message list was null or in an unexpected shape, so those messages were lost for good. The upgrade now keeps them, so such chats open with all their messages afterwards, and a single broken entry in the list no longer removes that message. Chats from older versions that also carry a plain list of their messages no longer get their first question added a second time.

Fixes #34991
2026-11-25 03:25:39 +04:00
Timothy Jaeryang Baek 5b75d3100a refac 2026-11-25 03:13:19 +04:00
Classic298 a4465917c7 fix: database upgrade stops startup when older chats were saved as plain text (#34988)
Older installs still hold chats saved as plain text. The database upgrade that moves chat messages out of the chat record stopped on the first one, so Open WebUI never started, and a downgrade failed the same way. The upgrade now reads these chats correctly. Installs whose upgrade already stopped start normally on this version.

Fixes #34985
2026-11-25 03:12:53 +04:00
Classic298 27c9bc1dcb refac: lock the knowledge base while moving a directory (#34982)
Moving a directory now locks its knowledge base before checking the new parent.
2026-11-25 03:10:55 +04:00
Classic298 b3e5766a06 refac: check machine selection changes on shared chats (#34983)
Choosing a machine template on a chat someone else owns now needs access to that template yourself.
2026-11-25 03:10:47 +04:00
Classic298 d8212c6865 fix: .mdx files fail to upload with Docling instead of being read as text like .md (#34981)
With Docling as the content extraction engine, an uploaded .mdx file failed with "File format not allowed" and ended up with no content, while the same page saved as .md worked. Browsers usually do not label .mdx files as text, so Open WebUI handed them to Docling or Tika instead of reading them itself, and the slim image refused them outright with the default engine. MDX pages are now read as text like Markdown with the default, Docling and Tika engines, so docs written in MDX can be added to chats and knowledge bases.

Fixes #34896
2026-11-25 03:07:46 +04:00
Timothy Jaeryang Baek bcff000ad7 refac 2026-11-25 03:07:28 +04:00
Classic298 a8e7ac3987 refac: single message updates keep other members' messages (#34980)
Single-message updates and message events are now refused for messages written by other chat members, matching how saving the whole chat already keeps them.
2026-11-25 03:07:06 +04:00
Classic298 d3e87f8b14 refac: keep membership filter on group share list (#34973)
Listing groups with sharing turned off now only returns groups the caller belongs to.
2026-11-25 03:02:08 +04:00
Classic298 d64df861a2 refac: only accept own folders as the new parent when moving a folder (#34978)
Moving a folder now only accepts a parent folder the user owns.
2026-11-25 03:01:50 +04:00
Classic298 bf616b21df refac: check participation type before lookup (#34979)
The encrypted channel relay now rejects a participation value that is not a string before looking it up.
2026-11-25 03:01:35 +04:00
Classic298 f605c1e4c5 refac: skip auto-join for group and dm channels on message insert (#34977)
Posting a message no longer adds the author as a member of group or direct message channels.
2026-11-25 03:00:47 +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 a548e9d752 refac: normalize browser view page path before proxying (#34975)
The browser view route now normalizes the page path on its own before adding the session prefix, the same way file previews already do.
2026-11-25 03:00:13 +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 2d1e7faba7 refac: note leave presence refresh (#34972)
Note presence is now refreshed on leave only for sessions tracked in the session pool.
2026-11-25 02:59:35 +04:00
Timothy Jaeryang Baek 72184499b1 refac 2026-11-25 02:52:26 +04:00
Timothy Jaeryang Baek 9d19883f15 chore: format 2026-11-25 02:36:30 +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 3226163dec refac 2026-11-25 02:31:48 +04:00
Timothy Jaeryang Baek 96c12237a8 refac 2026-11-25 02:31:09 +04:00