With Docling as the content extraction engine, an upload whose conversion never finished, or whose status check a proxy never answered, stayed processing forever and kept its worker thread until a restart. Enough of them used up every thread and the whole app stopped answering. A conversion now fails with a clear timeout error once it runs past the new API Timeout in Admin Settings > Documents (DOCLING_API_TIMEOUT, 300 seconds by default, like the MinerU one), and a request to docling-serve that gets no answer fails after the same time. Conversions that take longer than that now fail until the timeout is raised, and 0 removes the limit.
Fixes#35625
Before syncing, the sync client asks the server which files and folders changed. To answer, the server worked out each folder's full path by searching the whole folder list again for every parent folder, so the time grew with the square of the folder count. With tens of thousands of folders that took many minutes, blocked the server meanwhile and made the sync time out. The server now looks up each parent directly, so the folder step takes a fraction of a second.
<table>
<tr><th>Folders in the knowledge base (about 5 levels deep)</th><th>Before</th><th>After</th></tr>
<tr><td>5,000</td><td>3.1 s</td><td>5 ms</td></tr>
<tr><td>10,000</td><td>19.8 s</td><td>10 ms</td></tr>
<tr><td>20,000</td><td>219 s</td><td>43 ms</td></tr>
<tr><td>64,000</td><td>stopped after 25 min</td><td>151 ms</td></tr>
</table>
Over plain HTTP (no HTTPS) a browser allows only six connections to one server, and the page held one of them open per uploaded file until that file was processed. Uploading more than six files at once therefore blocked every other request from that browser, so opening another chat could take minutes. The page now hears when each file is done over the live connection it already keeps for chat updates, so other pages and chats stay responsive during bulk uploads.
Fixes#35613
Compacting a chat by hand stores the summary on the last reply, and that reply still carried the token count of the whole history the summary replaced. The server kept counting the chat at its size from before the compaction, so when later replies reported no token count, a short chat was compacted again a couple of messages later and its reported context usage stayed at the old size. The server now counts from what is actually left after the compaction. The context usage shown in the chat (/status) is worked out by the page itself and gets the matching change in a separate fix.
Related to #35678
When a long tool run compacted the chat partway through and the very next model call failed or was stopped, for example on a rate limit, the context gauge in /status and in the input area kept showing the size from before the compaction, such as 110% where about 1% was left, and the same happened while the answer after a compaction was still streaming. A manual /compact also left the gauge at the size of the history the summary replaced, such as 60% where a few dozen tokens were left. The page now counts only the summary and the messages after it, which is what the model receives next, and after a compaction during a tool run or a manual /compact it ignores token counts from before it until a call after it has answered. One shared function now does this count instead of the two copies the page kept, and it pairs with #35649 and #35679, which apply related rules on the server.
Fixes#35678
Related to #35644
When an identity provider added many people to a group in one sync, Open WebUI added them one at a time and re-checked the whole group and every connected session for each person, so large groups took minutes. All the people added in one request are now added together, and the resulting group membership is the same as before.
<table>
<tr><th>Members added in one sync</th><th>SQLite before</th><th>SQLite after</th><th>PostgreSQL before</th><th>PostgreSQL after</th></tr>
<tr><td>500</td><td>2.0 s</td><td>0.07 s</td><td>3.0 s</td><td>0.17 s</td></tr>
<tr><td>2,000</td><td>13.4 s</td><td>0.19 s</td><td>14.0 s</td><td>0.62 s</td></tr>
<tr><td>8,000</td><td>187 s</td><td>1.4 s</td><td>158 s</td><td>2.4 s</td></tr>
<tr><td>2,000 with 5,000 users online</td><td>19.7 s</td><td>0.96 s</td><td>31.2 s</td><td>0.32 s</td></tr>
</table>
In the desktop app, every finished reply popped up a toast even when that chat was open and the window was focused. Open WebUI asks the desktop app whether its window is focused, and current desktop versions do not support that request and answer with an error, which was read as "not focused". Only a real answer now counts, and otherwise the page's own visibility decides as in a normal browser.
Fixes#35622
Typing in a folder chat gets sluggish once a dozen chats are open as tabs. Every key press searched the whole page for an open dialog before checking whether the key was a tab shortcut at all, and that search gets slower with every open tab. Now only the tab shortcut keys trigger the search, so normal typing skips it and the shortcuts behave as before.
The table shows typing 40 characters with 12 folder chat tabs open, as the median of 8 interleaved runs per side (Chromium with 6x CPU slowdown, WebKit unthrottled).
<table>
<tr><th>action</th><th>browser</th><th>before</th><th>after</th></tr>
<tr><td>time the page is blocked while typing</td><td>Chromium</td><td>1012 ms</td><td>79 ms</td></tr>
<tr><td>time the page is blocked while typing</td><td>WebKit</td><td>2870 ms</td><td>864 ms</td></tr>
<tr><td>delay from key press to screen update</td><td>Chromium</td><td>58 ms</td><td>43 ms</td></tr>
<tr><td>delay from key press to screen update</td><td>WebKit</td><td>63 ms</td><td>35 ms</td></tr>
</table>
Fixes#35688
Attaching a damaged HEIC photo failed badly: the chat input did nothing, a channel showed "[object Object]" and a note showed an upload that never finished. Now each of them shows an error and attaches nothing. Photos that convert fine upload as before.
Fixes#35580
After a burst of file uploads and long chats, the process kept most of the memory it needed at the peak, and every further burst added more. On Linux with glibc, blocks of 1 MB and larger now go back to the system as soon as they are freed, which stops the growth, and every 30 seconds the freed memory glibc still holds is returned too, which brings the level down further. `MALLOC_RELEASE_THRESHOLD` sets that size in bytes and `MALLOC_TRIM_INTERVAL` that interval in seconds, and `0` turns either one off. While the threshold is on, it overrides glibc's own `MALLOC_MMAP_THRESHOLD_` and `MALLOC_TRIM_THRESHOLD_`. The median request took about 9% longer on this upload-heavy load (9.8 s to 10.7 s) with both on.
900 chats with a file upload each, in six bursts of 150. The process sat at 1.18 GB before the load in every run.
<table>
<tr><th></th><th>Memory after the load</th></tr>
<tr><td>Without the change</td><td>4.47 GB, still climbing</td></tr>
<tr><td>Immediate release only</td><td>1.95 GB</td></tr>
<tr><td>Periodic release only</td><td>4.26 GB, still climbing</td></tr>
<tr><td>Both</td><td>1.52 GB, flat</td></tr>
</table>
Fixes#35590