Commit Graph
6217 Commits
Author SHA1 Message Date
Classic298 63a77928b9 fix: Docling uploads never finish and hold a worker thread when docling-serve stalls (#35639)
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
2026-12-05 08:06:34 +04:00
Classic298 024181dd2d perf: knowledge base sync with many folders no longer times out (#35630)
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>
2026-12-05 08:04:01 +04:00
Classic298 1e926668bc fix: browser stalls while many uploaded files are still processing (#35633)
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
2026-12-05 08:03:53 +04:00
Classic298 22f8516dd9 fix: a chat compacted on demand is compacted again although little is left (#35679)
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
2026-12-05 08:03:38 +04:00
Classic298 a710766e33 perf: SCIM group syncs that add many members finish in seconds instead of minutes (#35629)
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>
2026-12-05 07:56:35 +04:00
Timothy Jaeryang Baek 516e60966d refac 2026-12-05 07:06:03 +04:00
Timothy Jaeryang Baek 7de92922fa refac 2026-12-05 06:57:35 +04:00
Classic298 f913c3ef24 perf: return freed memory to the system after traffic bursts (#35593)
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
2026-12-04 07:43:07 +04:00
Timothy Jaeryang Baek 4116a5bffe refac 2026-12-04 07:30:14 +04:00
Timothy Jaeryang Baek acc8823259 refac 2026-12-04 06:53:09 +04:00
Timothy Jaeryang Baek 0481ad7c2e refac 2026-12-04 06:30:25 +04:00
Timothy Jaeryang Baek d426c4485a refac 2026-12-04 05:48:10 +04:00
Timothy Jaeryang Baek 0d8eac0eb5 refac 2026-12-04 04:59:34 +04:00
Timothy Jaeryang Baek b55c9032e0 refac 2026-12-04 04:35:31 +04:00
Timothy Jaeryang Baek ccc46ec0c3 refac 2026-12-04 04:15:37 +04:00
Timothy Jaeryang Baek 8cf761d363 refac 2026-12-03 23:56:09 +04:00
Timothy Jaeryang Baek 3f4fefdb00 refac 2026-12-03 05:32:07 +04:00
Timothy Jaeryang Baek 9f42251b32 refac 2026-12-03 05:31:41 +04:00
Timothy Jaeryang Baek 6a9c337688 refac 2026-12-03 05:28:06 +04:00
Timothy Jaeryang Baek ecc7ebf690 refac 2026-12-03 05:18:45 +04:00
Timothy Jaeryang Baek 6a575880de refac 2026-12-03 04:26:01 +04:00
Timothy Jaeryang Baek 5c58c96408 refac 2026-12-03 04:02:11 +04:00
Timothy Jaeryang Baek ca16f2c576 refac 2026-12-03 03:55:38 +04:00
Classic298 b6317157f3 fix: a folder's instruction file is left out when it and the home AGENTS.md fit 32 KiB together (#35564)
The 32 KiB limit for AGENTS.md files counted the heading added in front of the one in the machine's home folder as if it were file content. A home file and a folder's AGENTS.md or CLAUDE.md that together are exactly 32 KiB therefore lost the folder's instructions, while a single 32 KiB home file was accepted. The limit now counts only the files themselves, the same way for one file and for two.

Fixes #35559
2026-12-03 03:21:03 +04:00
Classic298 2026de4bcb fix: note search shows no excerpt when the match is deep inside a note (#35561)
Searching Notes for words that appear far into a note listed the note but showed no excerpt next to its title, because the search results only carried the start of each note. The results now carry the part of the note around the first match instead, and each result stays as small as before, so the words around the match show up wherever they are in the note. While searching, the grid preview of such a note starts near the match too. Matches near the start and matches only in the title look the same as before.

Fixes #35556
2026-12-03 03:20:54 +04:00
Classic298 e160769e2f fix: very large system prompts can freeze the server (#35560)
A system prompt with many repeated tool approval policy or tool list markers and no closing marker took time growing with the square of its size to clean up, tens of seconds or more for half a megabyte. The tool approval cleanup runs on every chat request and blocks the server while it runs, so one oversized request stalled every user on that server process. Both cleanups now ignore the text after the last closing marker, which can never be removed anyway, so the same input takes under a millisecond and the cleaned prompt is the same as before.
2026-12-03 03:20:46 +04:00
Classic298 0d3f6b6ced fix: deleting an account leaves its saved folder layouts behind (#35558)
When an admin deleted an account, the tab and pane layouts that person had saved in folders stayed stored, while their chat layouts were removed. Deleting an account now also removes its folder layouts. Other people's layouts are not touched.

Fixes #35555
2026-12-03 03:20:35 +04:00
Classic298andkamyar 0540fd80dc chore: bump fastapi to 0.163.2 (#35554)
Moves FastAPI from 0.136.3 to 0.163.2. The new FastAPI needs OpenTelemetry 1.44 or newer, so the OpenTelemetry packages move from 1.42.1 to 1.44.0 (and from 0.63b1 to 0.65b0) along with it. No other package changes version. With OpenTelemetry metrics or logs on and traces off, the new FastAPI would also send its own request metrics and error logs on top of the ones Open WebUI already sends (and its metrics would not skip the excluded URLs), so that is turned off and the OpenTelemetry output stays the same as before. Sign-in, file uploads with and without metadata, chats and user search were checked against the old version and behave the same.

Co-authored-by: kamyar <932743+kamyar@users.noreply.github.com>
2026-12-03 02:22:17 +04:00
Classic298 87717d89dc fix: stateful Responses API chats fail with "Duplicate item found" after a tool call (#35525)
With ENABLE_RESPONSES_API_STATEFUL on and encrypted reasoning requested, the request after a tool call sent the model's encrypted reasoning again although OpenAI already has it from the previous response. OpenAI rejects that with HTTP 400 "Duplicate item found", so every chat that used a tool failed right after the first tool ran. The follow-up now sends only the tool calls and their results, as it did before v0.13.5. Connections without stateful mode still send the reasoning back.

Fixes #35515
2026-12-03 01:27:49 +04:00
Classic298 7e4fcb0826 fix: model answers in channels fail with "Error: name 'copy' is not defined" (#35545)
Every model answer in a channel failed right away with "Error: name 'copy' is not defined", so a mentioned model never replied and automations that post into a channel ended each run with that error. A recent cleanup removed an import that channel replies still relied on. The import is restored, so model answers and automation runs in channels work again.

Fixes #35543
2026-12-03 01:19:18 +04:00
Classic298 9fb0444360 fix: programs keep failing on modules and files the sandbox does not have (#35548)
The description models see for programmatic tool calling said no other modules or files were available, but models still imported missing modules or tried to read files from disk, and each of those programs failed. The description now names a missing module and says plainly that nothing can read files or the network, so the data has to come through tools. I measured it on 10 coding tasks with five models, about 300 programs per wording over several runs, against the description now on dev, which already carries most of the wording from #35514. It costs about 15 more tokens per request, and the total tokens per chat stayed within the noise between runs.

<table>
<tr><th>Share of programs or chats</th><th>Before</th><th>After</th></tr>
<tr><td>Programs that failed</td><td>24%</td><td>18%</td></tr>
<tr><td>Programs importing a missing module</td><td>8%</td><td>4%</td></tr>
<tr><td>Programs trying to read files</td><td>11%</td><td>3%</td></tr>
<tr><td>Chats whose first program failed</td><td>37%</td><td>22%</td></tr>
<tr><td>Correct answers</td><td>96%</td><td>97%</td></tr>
</table>

Refs #35514
2026-12-03 01:13:41 +04:00
Classic298 c4638647f8 fix: programs fail when a model passes a tool's arguments as one dict (#35547)
Models using programmatic tool calling often pass all of a tool's arguments as a single dict, the way an ordinary tool call looks, instead of as named arguments. That call failed the whole program, so the model had to notice and run it again. Both forms now call the tool with the same arguments, and a dict plus extra named arguments is merged, with the named ones winning. A single plain value or more than one unnamed value still fails.
2026-12-03 01:13:28 +04:00
Classic298 03cdec3fab fix: info logs flooded by per-request trace lines (#35538)
The info log was filled with step-by-step lines that fire on every chat with knowledge or web search, chat search, file upload, document parsing, knowledge base update or search, image generation, note chat and collaborative note editing, so running at INFO in production buried the lines an admin actually needs. Every sign-in also wrote the user's email address to the info log. These lines, the email one included, now only show with GLOBAL_LOG_LEVEL=DEBUG. Results such as documents added to or removed from the vector database and admin actions keep their line at info. A few unused internal leftovers are removed, which no setting or feature relied on.

Fixes #35535
2026-12-03 00:32:29 +04:00
Classic298 1924c30ff5 fix: the installed app's launch screen flashes a lighter grey than the dark page (#35542)
Open WebUI's dark background became a darker grey, but the app added to the home screen still opened on the old one, so every launch flashed a slightly different grey before the app appeared. Its launch screen and the phone's status bar now use the same dark grey as the page.

Fixes #35541
2026-12-03 00:32:09 +04:00
Timothy Jaeryang Baek 792dcb2ff9 refac 2026-12-03 00:03:39 +04:00
Timothy Jaeryang Baek 209ffacbf2 refac 2026-12-02 20:32:53 +04:00
Timothy Jaeryang Baek 6d277752eb refac 2026-12-02 19:52:49 +04:00
Timothy Jaeryang Baek 90bdabcb35 refac 2026-12-02 19:42:08 +04:00
Timothy Jaeryang Baek 0b7f8b2498 refac 2026-12-02 04:30:51 +04:00
Timothy Jaeryang Baek 05e2a6bbe2 refac 2026-12-02 03:58:13 +04:00
Timothy Jaeryang Baek e4264ec664 refac 2026-12-02 03:35:42 +04:00
Timothy Jaeryang Baek 076f6fb339 refac 2026-12-02 03:33:58 +04:00
Classic298 422ab8304b fix: Ollama port check runs at startup even when Ollama is disabled (#35453)
With ENABLE_OLLAMA_API=false and no Ollama URL set, every startup still tried to connect to Ollama on ports 11434 and 12434 and logged that both were unreachable. On hosts that silently drop the connection this also held up startup for about a second. The check now only runs when Ollama is enabled.

Fixes #35442
2026-12-01 19:59:47 +04:00
Classic298 0d71ed03bb fix: the installed app's launch screen flashes a blue-grey that is not the app's colour (#35418)
The generated web app manifest set #343541 as the background colour, so every launch of the installed app on Android flashed a blue-grey used nowhere else in the app, and it set no theme colour. Both now use the app's own dark background, the same colour as the page's theme colour.

Fixes #35410
2026-12-01 02:33:30 +04:00
Classic298 35564622fe fix: event webhooks subscribed to a renamed event vanish after upgrading (#35417)
Several events were renamed, and admin event webhooks saved under the old names were treated as invalid: they disappeared from the webhook list, stopped firing, and were deleted the next time any webhook was saved. Creating a notification target with an old name was refused as well. Old event names are now accepted and translated to the new ones, for event webhooks and notification targets alike, as was already done for an earlier rename.

Fixes #35413
2026-12-01 02:33:19 +04:00
Timothy Jaeryang Baek d56c3f304c refac 2026-12-01 02:21:33 +04:00
Timothy Jaeryang Baek 4a51726230 refac 2026-12-01 01:58:55 +04:00
Classic298 4fce9764f9 fix: text-to-speech and speech-to-text fail on Windows for text outside the system code page (#35096)
On Windows with a non-UTF-8 code page like cp1252, reading a message aloud or transcribing audio returned a 500 with "'charmap' codec can't encode character" whenever the text held characters the code page lacks, such as arrows, CJK or emoji. The audio or transcript had already come back from the provider, but saving its cache file failed because the file was written in the Windows code page. These cache files are now always written as UTF-8, so the request succeeds on any Windows language setting. Text-to-speech through an OpenAI connection had the same problem and is fixed too. It only showed up once ENABLE_ORJSON became the default.

Fixes #35087
2026-12-01 01:49:18 +04:00
Classic298 fc0f0701c5 fix: editing or resuming an automation shows a Next run after its expiry (#35404)
Editing an automation while leaving its expiry as it is, for example moving its schedule later, or resuming a paused automation whose expiry has passed, saved a next run after the expiry. The page showed it as Next run and the model's update tool reported it back, though that run never happens. That next run is now dropped, and the page shows "Not scheduled" instead. The list of upcoming runs is cut at the expiry separately, in #35399.

Fixes #35401
2026-12-01 00:50:34 +04:00
Timothy Jaeryang Baek 1c59e41e5f refac 2026-12-01 00:41:27 +04:00