Commit Graph
6146 Commits
Author SHA1 Message Date
Classic298 c865616f9a perf: stop web search URL checks from blocking the server (#35252)
Each web search resolved the address of every result site before loading it, and those lookups blocked the whole server. With many results or a slow DNS server, other users' requests stalled until all of them finished. The lookups now run without holding up other users.

<table>
<tr><th></th><th>Before</th><th>After</th></tr>
<tr><td>Longest server stall, 20 results at 50 ms per lookup</td><td>1020 ms</td><td>11 ms</td></tr>
</table>

Relates to #35245
2026-11-30 23:04:13 +04:00
Classic298 3592825be8 perf: keep the server responsive while image and video uploads are checked (#35251)
Uploading an image or video made the server check whether the file was really text first. With S3, GCS or Azure storage that check downloads the whole file, and the server stopped responding to everyone else until the download finished. The check now runs without holding up other users, so large media uploads no longer stall chats and page loads.

<table>
<tr><th></th><th>Before</th><th>After</th></tr>
<tr><td>Longest server stall with a 0.5 s storage download</td><td>511 ms</td><td>12 ms</td></tr>
</table>

Relates to #35245
2026-11-30 23:04:03 +04:00
Classic298 e4ef437a8a perf: Azure Entra ID connections no longer stall the server while fetching a token (#35246)
Every request on a connection using Microsoft Entra ID authentication fetched a fresh access token, and the server stalled for all users while it waited for Azure to answer. The token is now fetched without holding up other users' requests, and it is reused until it is close to expiring instead of being fetched again on every request.

<table>
<tr><th></th><th>Before</th><th>After</th></tr>
<tr><td>Longest server stall, two requests with a 300 ms token fetch</td><td>611 ms</td><td>11 ms</td></tr>
<tr><td>Token fetches for two requests</td><td>2</td><td>1</td></tr>
</table>

Relates to #35245
2026-11-30 23:02:09 +04:00
Classic298 fcfdc472a7 feat: find models by their ID in the admin and workspace model search (#35297)
Searching in Admin Settings > Models only matched the display name, and Workspace > Models matched the name, the base model and the owner but not the model's own ID. A model that was renamed, or whose name differs from its ID, could not be found by typing the ID that the tooltip and the API show. Both searches now match the ID too, like the chat model selector, tools and functions searches already do.

Fixes #35296
2026-11-30 23:01:02 +04:00
Classic298 0e984be144 perf: keep the server responsive during large skill imports and exports (#35250)
Importing or previewing a large skill archive, or exporting skills as a zip, froze every other user's requests on the server while the archive was unpacked or compressed. Exporting a 47 MB skill stalled the server for about a second. Unpacking and compressing now run without holding up other users, and the imported skills and exported archives are unchanged.

<table>
<tr><th>Action (47 MB skill)</th><th>Longest server stall before</th><th>After</th></tr>
<tr><td>Import zip</td><td>361 ms</td><td>53 ms</td></tr>
<tr><td>Import folder</td><td>334 ms</td><td>111 ms</td></tr>
<tr><td>Export zip</td><td>1005 ms</td><td>17 ms</td></tr>
</table>

Relates to #35245
2026-11-30 22:58:54 +04:00
Classic298 b017958361 perf: keep presence and access updates from stalling instances that use Redis (#35248)
With Redis as the websocket manager, opening or leaving a chat or note, moving the cursor in a shared note, disconnecting, and access changes each read through the whole shared session list. While that ran the worker answered no one else, so on an instance with thousands of connected sessions everyone on that worker saw stalls on every one of those events. The session list is now read batch by batch without holding up other users, and presence and access results are unchanged. Setups without Redis keep reading the in-memory list directly.

<table>
<tr><th>Sessions</th><th>Redis round trip</th><th>Longest stall before</th><th>Longest stall after</th></tr>
<tr><td>5,000</td><td>local</td><td>8 to 10 ms</td><td>about 2 ms</td></tr>
<tr><td>5,000</td><td>1 ms</td><td>40 to 46 ms</td><td>about 2 ms</td></tr>
<tr><td>20,000</td><td>1 ms</td><td>150 to 169 ms</td><td>2 to 3 ms</td></tr>
</table>

Relates to #35245
2026-11-30 22:55:25 +04:00
Classic298 555f5516b9 perf: keep the server responsive while photos are prepared for image editing (#35249)
When a photo is sent for an image edit, Open WebUI first rotates and re-encodes it so the provider sees it upright. That work stalled every other chat and request on the server for its full duration, about 130 ms per 12 MP photo and longer with each extra image in the request. It now runs without holding up other users, and the edited images are unchanged.

<table>
<tr><th>Request</th><th>Longest server stall before</th><th>After</th></tr>
<tr><td>1 photo (12 MP)</td><td>136 ms</td><td>23 ms</td></tr>
<tr><td>3 photos (12 MP)</td><td>377 ms</td><td>19 ms</td></tr>
</table>

Relates to #35245
2026-11-30 22:55:15 +04:00
Classic298 21d677b440 fix: /health/db fails with a 500 and logs a traceback when the database is down (#35275)
With the database unreachable, every /health/db check failed with an error nothing caught, so monitoring got a bare 500 and the log got a full traceback each time. It now answers 503 "Database not ready" with a one-line warning, the same way /ready handles a database that does not answer.

Fixes #35274
2026-11-30 22:51:56 +04:00
Timothy Jaeryang Baek 406fe308c0 refac 2026-11-30 22:49:49 +04:00
Classic298 48d8e2ff1c fix: assistant's automation is refused when it leaves out the action type (#35384)
When the assistant created or changed an automation from a chat, the tool told it an action's type was optional and defaulted to a prompt, but an action sent without it was refused with a raw validation error and nothing was saved. An action without a type is now read from what it holds, as a prompt or as code, so the automation is created or updated as the assistant was told it would be.

Fixes #35379
2026-11-30 22:48:05 +04:00
Classic298 3d6a092c76 fix: a failed Codex turn shows a raw object as the error instead of Codex's message (#35385)
When Codex failed a turn, the reply's error showed Codex's whole error object, field names and all, instead of the reason. The error now shows Codex's own message, the same way Claude Code and Pi failures show theirs.

Fixes #35381
2026-11-30 22:41:11 +04:00
Timothy Jaeryang Baek 82ab95e420 refac 2026-11-30 22:40:50 +04:00
Timothy Jaeryang Baek 2e648b7e58 refac 2026-11-30 22:38:50 +04:00
Classic298 6ea7d06322 fix: assistant could create automations past the limit when it gave no schedule (#35382)
When an admin limits how many automations a user may have, a user at that limit could still get the assistant to create more, as long as it left out the schedule. The limit is now checked on every automation the assistant creates, with or without a schedule, exactly as on the Automations page. Admins stay unlimited.

Fixes #35378
2026-11-30 22:37:33 +04:00
Timothy Jaeryang Baek 55521ccd27 refac 2026-11-30 22:35:04 +04:00
Classic298 508d273a5f fix: channel automation run is recorded as success when the model call fails (#35376)
An automation that posts to a channel was recorded as successful as soon as it started, so a failed model call still showed as Ran in Activity. The run now waits for the channel reply to finish, as a chat run already does. A reply that fails, also partway through, is recorded as failed with the error text.
2026-11-30 22:25:55 +04:00
Classic298 588d58b9ff fix: model answers the previous question after compaction between tool calls (#35375)
When context compaction ran between tool calls and the messages it kept still included an earlier question, the current prompt was moved in front of that earlier question. The model then saw the previous question as the latest one and answered it again. The current prompt now stays in its place when it is still among the kept messages, and is only put back in front of them when compaction removed it.

Fixes #35366
2026-11-30 22:25:28 +04:00
Timothy Jaeryang Baek affe67b7df refac 2026-11-30 21:27:41 +04:00
Timothy Jaeryang Baek 00bc5c3dc8 refac 2026-11-30 21:03:32 +04:00
Classic298 2a01914ff0 feat: tools and functions must be written with async def (#35240)
Tools and functions written with plain def ran on the server's main loop, so a slow call inside one, such as an HTTP request, froze Open WebUI for every user on that server until it returned. Saving a tool or function in the editor now fails with an error that names every tool method or function hook (pipe, pipes, inlet, request, outlet, stream, action, event) still written with plain def. Tools and functions saved before this are switched off the next time they fail to load, the same way a function that fails to load is already switched off, and that also applies to any other load failure of a tool. Either can be switched back on once its code is updated. The starter code in both editors is async now.

Discussion: https://github.com/open-webui/open-webui/discussions/35238
2026-11-30 18:48:49 +04:00
Classic298 2c36482e1d fix: readiness probes on /ready fill the access log (#35259)
Kubernetes and other orchestrators are pointed at /ready for readiness probes, and every probe wrote a "GET /ready" line to the access log, per pod, every few seconds. /health was already kept out of the access log, and now /ready is too.

Fixes #35258
2026-11-30 18:43:23 +04:00
Classic298 530ef42876 fix: SCIM requests and LDAP logins write internal debug lines at INFO (#35277)
Every SCIM request from an identity provider logged the raw ENABLE_SCIM value and its Python type, and every LDAP login logged the attributes it asks the directory for and, with group management on, every step of reading the user's groups line by line, all at the default INFO level. Loading the account pending screen also logged the admin email next to a name that was always empty. These now log at DEBUG and that admin line is gone. The LDAP summary of a user's groups still logs at INFO.

Fixes #35276
2026-11-30 18:42:48 +04:00
Classic298 9f7c08ff7f fix: Ollama embedding requests log the full input text (#35273)
Every embeddings request for an Ollama model, through the Ollama endpoints or the general embeddings endpoint, logged the whole request, including all the text being embedded, at the default INFO level. That puts user content into the logs and makes huge log lines for large batches. The line now logs at DEBUG.

Fixes #35272
2026-11-30 18:42:26 +04:00
Classic298 2d03af81ef fix: paged lists repeat some entries and skip others (#35281)
The admin user list, feedbacks, groups, the workspace models, prompts and skills lists, prompt history, notes, shared chats, automations, calendar search, analytics messages and SCIM user listings are loaded page by page, and when many rows share the sorted value (a role, a bulk-import timestamp, a rating) the database is free to return those ties in a different order for each page. On PostgreSQL 16, paging through 300 users sorted by role showed 16 users twice and never showed 16 others, and with an id tiebreaker every user showed up exactly once. These lists now sort by each entry's id as a last step, as the chats and knowledge lists already do.

Fixes #35280
2026-11-30 18:41:44 +04:00
Classic298 529bb58b9a fix: a native Codex chat stops as soon as one of its subagents finishes (#35230)
When Codex started a subagent in a native Codex chat, the chat ended the moment that subagent finished, even though the main task was still working. The reply was saved as finished with whatever had arrived so far, and Codex recorded the main task as interrupted. A failing subagent also failed the whole chat with its own error. The chat now ends only when the main task itself finishes, and an error from the main task still shows.

Fixes #35226
2026-11-30 18:34:02 +04:00
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
G30 faea95e272 perf: opening a chat no longer reads all its messages again to restore its tabs (#35202) 2026-11-30 18:31:23 +04:00
Classic298 836a434dc9 feat: allow function sync without created_at and updated_at (#35244)
Scripts calling POST /api/v1/functions/sync had to send created_at and updated_at for every function, or the whole request was rejected with "Field required". Both are now optional. When they are left out, a new function gets the current time and an existing function keeps its original creation time, while updated_at is set by the server as before. Payloads that include them, such as the output of GET /api/v1/functions/export, work as they do today.

Fixes #35243
2026-11-30 18:28:17 +04:00
Classic298 28ee8cd0b0 fix: Reset Vector Storage shows Success before the reset has finished (#35344)
Confirming Reset Vector Storage/Knowledge in the Documents settings showed a Success toast right away, even when the reset then failed on the server. The toast now waits for the reset and only shows Success once it actually went through.

Fixes #35343
2026-11-30 18:25:44 +04:00
Classic298 36522bbbb6 fix: connection check shows Network Problem instead of the real error (#35346)
Verifying an Anthropic or Ollama connection with a wrong API key showed only "OpenAI: Network Problem" or "Ollama: Network Problem", while the actual reason from the provider was there but got lost. The toast now shows the provider's error, and OpenAI-compatible connections still show theirs.

Fixes #35345
2026-11-30 18:25:36 +04:00
G30 f725d5c759 chore: a reply cut off by a closed model connection says so in plain words (#35141) 2026-11-27 17:26:56 +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 79d556efda refac 2026-11-27 15:18:31 +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
Classic298 b6f0d483ed perf: removing files from a large knowledge base on pgvector gets slower the bigger it grows (#35123)
With pgvector, removing, updating or re-syncing a file in a knowledge base scanned every chunk of that knowledge base to find the file's own chunks, and so did the check for a duplicate upload. A cleanup of 94 files through the knowledge base sync API, in a knowledge base of 756,000 chunks, took about a minute, long enough for sync clients to time out. These lookups now use indexes instead of scanning the whole knowledge base. The indexes are built once on the first start after upgrading, which took under 3 seconds on a table of 1.5 million chunks. They are skipped when PGVECTOR_PGCRYPTO is enabled, because encrypted metadata cannot be indexed, so those setups keep the old speed.

<table>
<tr><th>756,000 chunks in the knowledge base</th><th>Before</th><th>After</th></tr>
<tr><td>Sync cleanup, 94 files</td><td>60.8 s</td><td>0.96 s</td></tr>
<tr><td>Remove one file</td><td>631 ms</td><td>22 ms</td></tr>
<tr><td>Update one file</td><td>973 ms</td><td>488 ms</td></tr>
<tr><td>Reject a duplicate upload</td><td>204 ms</td><td>70 ms</td></tr>
</table>

Fixes #35122
2026-11-27 02:37:19 +04:00
Classic298 ee188b4316 fix: use the Youtube Proxy URL for YouTube transcripts even when HTTPS_PROXY is set (#35124)
With HTTPS_PROXY set on the server, fetching a YouTube transcript went through that proxy instead of the configured Youtube Proxy URL, without any message saying so. Servers behind a company proxy got the "YouTube blocked the transcript request" error even though they had set a separate proxy for YouTube. The Youtube Proxy URL now always wins when it is set, and HTTPS_PROXY is still used when it is not. Custom CA certificates set through REQUESTS_CA_BUNDLE keep working either way.

Fixes #35121
2026-11-27 02:36:54 +04:00
Classic298 1e68fa8d18 fix: with several workers, chats go to the wrong connection after a connection is deleted (#35119)
With UVICORN_WORKERS above 1, deleting an OpenAI or Ollama connection left every worker except the one that saved the change sending some models to the wrong connection, so chats failed with "model not found" until a restart. The admin panel showed the right connection the whole time. The workers now share which connection serves each model through Redis, which several workers already require, so a change reaches all of them at once.

Fixes #35114
2026-11-27 01:19:28 +04:00
G30 de696d4b4a fix: check ui translation placeholders against the default text (#35127) 2026-11-26 23:44:04 +04:00
Timothy Jaeryang Baek 4d49c6d950 refac 2026-11-26 21:25:16 +04:00
Timothy Jaeryang Baek ee7846286c refac 2026-11-26 18:25:14 +04:00
Timothy Jaeryang Baek c456a6dbfd refac 2026-11-26 18:14:38 +04:00
Timothy Jaeryang Baek ee38c0213c refac 2026-11-26 16:55:05 +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
Timothy Jaeryang Baek 4b648ec4e7 refac 2026-11-26 02:04:30 +04:00