Commit Graph
2033 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 0f3bd0a7ea refac 2026-11-06 12:40:49 +09:00
Timothy Jaeryang Baek 768a83ae78 refac 2026-11-06 11:59:05 +09:00
Timothy Jaeryang Baek 6e8a6c4467 refac 2026-11-06 11:34:51 +09:00
Timothy Jaeryang Baek bd6fc15bee refac 2026-11-06 11:12:04 +09:00
Timothy Jaeryang Baek 8e2ba2937e refac 2026-11-06 10:38:09 +09:00
Timothy Jaeryang Baek 7f3e0d018e refac 2026-11-06 09:02:24 +09:00
Timothy Jaeryang Baek 97f71f6ebb refac 2026-11-06 08:53:00 +09:00
Timothy Jaeryang Baek d878373728 refac 2026-11-06 08:41:30 +09:00
Classic298 c384d8e514 fix: split tool calls leave an extra unfinished tool call in the chat (#33779)
When a model sends several tool calls glued into one (for example GPT-5.4 putting two JSON argument sets in a single call), Open WebUI ran each part but also kept the original call in the message with the broken combined arguments and no result. That showed up as an extra tool call that never gets a result, and it was dropped silently when the chat was sent back to the model. The first part now reuses the original call, so every tool call in the message has exactly one result.

Fixes #33778
2026-11-06 08:19:36 +09:00
Classic298 dd42f4e913 refac: skip background work for accounts that were deactivated meanwhile (#33801)
Follow-up generation after a response and replies to channel mentions are now skipped when the account that triggered them has been deactivated in the meantime.
2026-11-06 07:53:32 +09:00
Classic298 f59552efff perf: stop resending the whole reply on every reasoning chunk with OpenRouter-style providers (#33698)
Providers such as OpenRouter attach reasoning details to every reasoning chunk, and each of those chunks made Open WebUI send the entire reply so far to the browser and, with Redis, rewrite the copy kept for page reloads. The browser never shows these details, so a long reasoning reply moved tens of megabytes for a few kilobytes of text. Those chunks now stream like any other reasoning text, and the details are still saved with the reply and still sent back to the provider on the next request.

Measured against a simulated OpenRouter-style provider streaming 1,500 reasoning chunks:

| | before | after |
|---|---|---|
| Data sent to the browser | 73.6 MB | 0.73 MB |
| Redis writes for the reload copy | 1,504 | 19 |
2026-11-05 22:30:39 +09:00
Classic298 b6d861645b fix: chat stops working with Ollama after a tool call with broken arguments (#33697)
A tool call whose arguments were cut off, rejected before it ran or sent empty made every later message with an Ollama model fail, so the chat stayed stuck until that message was edited or removed. Such calls are now sent to Ollama with empty arguments and the conversation continues.

Fixes #33671
2026-11-05 22:27:27 +09:00
Timothy Jaeryang Baek 8366e28725 refac 2026-11-05 21:59:46 +09:00
Timothy Jaeryang Baek bb89844517 refac 2026-11-05 20:47:26 +09:00
Classic298 5beeb0cc29 fix: every chat message fails on a Redis Cluster deployment (#33766)
With REDIS_CLUSTER enabled, every chat message failed with an error. The Redis connection recently added for terminal connections was used before it had read the cluster's layout. That connection now reads the layout first, so chats work again on a Redis Cluster. Plain Redis and Sentinel setups behave as before.

Fixes #33765
2026-11-05 18:40:11 +09:00
Timothy Jaeryang Baek 393dd6689c refac 2026-11-05 17:32:32 +09:00
Timothy Jaeryang Baek 6b826c7585 refac 2026-11-05 16:54:50 +09:00
Timothy Jaeryang Baek c16b77ba07 refac 2026-11-05 13:57:52 +09:00
Timothy Jaeryang Baek a773323e4a refac 2026-11-05 12:32:27 +09:00
Timothy Jaeryang Baek 457f2edd2d refac 2026-11-05 12:29:50 +09:00
Timothy Jaeryang Baek 69189cbaad refac 2026-11-05 12:01:25 +09:00
Timothy Jaeryang Baek 99f4541e3b refac 2026-11-05 12:00:17 +09:00
Timothy Jaeryang Baek 404d27a36e refac 2026-11-05 11:41:25 +09:00
Classic298andxfscott a7e51207c0 fix: audit log records API keys and tokens in plain text (#33746)
With request auditing turned on, only fields whose name ends in "password" were masked, so API keys and tokens saved in the admin settings (OpenAI and Ollama connections, Jupyter, web search and others) were written to the audit log as they were. A secret cut off by the body size limit also had its beginning logged. Fields whose name ends in password, secret, token, key or authorization are now masked, including lists of keys and values cut off by the size limit.

Co-authored-by: xfscott <229475069+xfscott@users.noreply.github.com>
2026-11-05 07:19:24 +09:00
Classic298 051c357f98 refac: limit nesting depth of model settings (#33759)
Model meta and params are now rejected when they are nested too deeply.
2026-11-05 07:19:09 +09:00
Classic298 9db6251498 perf: large chats open about twice as fast (#33665)
Before a chat is stored or returned, the server checks all of its text for null bytes and invalid characters that the database cannot store. That check converted the whole chat to JSON text and scanned it, which on chats with long histories or pasted images took as long as reading the chat from the database, and blocked every other request on that server process meanwhile. The check now inspects each text value in place and skips the slow scan for plain ASCII values such as base64 images. It flags exactly the same chats as before, except that chats containing the six characters \u0000 as ordinary text (common in code) no longer go through a needless cleanup copy on every load.

Measured on SQLite, best of 5 runs, sizes are the stored chat JSON:

| Chat | Check before | Check after | Opening the chat before | Opening the chat after |
| --- | --- | --- | --- | --- |
| 7 MB, text only | 13 ms | 2 ms | 31 ms | 20 ms |
| 49 MB, with images | 107 ms | 4 ms | 211 ms | 108 ms |
| 209 MB, with images | 456 ms | 15 ms | 890 ms | 444 ms |
2026-11-05 06:44:48 +09:00
Classic298 275e0f40e5 fix: context compaction summary cut off at 1000 tokens (#33726)
Without Task Model Params set, the compaction summary was capped at 1000 tokens. Reasoning models could spend all of that on thinking and return an empty or cut-off summary, which then replaced the chat's context. The summary request now carries no token limit of its own unless Task Model Params sets one, so the provider's normal limits apply.
2026-11-05 06:43:07 +09:00
Classic298 623257af76 fix: deprecation warnings when refreshing OAuth tokens with a client secret (#33700)
Refreshing an OAuth token, or checking a token's client during token exchange, with the client secret sent over HTTP Basic logged aiohttp deprecation warnings on every call. aiohttp removes the deprecated helper in 4.0, after which these requests would fail. The Authorization header is now built with aiohttp's recommended replacement, and what the provider receives is unchanged. Fixes #33297
2026-11-04 06:00:36 +09:00
Classic298 5232f9bb24 fix: terminal connections using Session auth fail Verify Connection and never load the terminal tools (#33699)
A terminal connection with Auth set to Session had no API key field, so Verify Connection, the policy settings and the tool list request all went out without the orchestrator's key and were rejected as unauthorized. That left the policy dropdown empty and chats failing with "Terminal server is unavailable". Session connections now have the API key field, and the key is sent for those admin and discovery calls the same way Bearer connections already do. Terminals that users open still sign in with the user's own session.

Fixes #30001
Fixes #33579
2026-11-04 05:34:32 +09:00
Classic298 323f7353bf perf: chat access checks no longer load the whole conversation (#33667)
Typing indicators, sending a message, shared links, comments and file access all check whether the user may access the chat, and each check loaded the full chat, images included, only to look at who owns it and which folder it is in. On large chats that delayed every other request on the same server process by up to a few hundred milliseconds per check. The check now reads just those few fields, and who gets access is unchanged.

Measured on SQLite, best of 5 runs, sizes are the chat as stored in the database:

| Chat | Checked for | Before | After |
| --- | --- | --- | --- |
| 7 MB, text only | the chat owner | 34.6 ms | 0.36 ms |
| 7 MB, text only | a user with access through a shared folder | 35.1 ms | 2.58 ms |
| 57 MB, with images | the chat owner | 249.8 ms | 0.72 ms |
| 57 MB, with images | a user with access through a shared folder | 249.0 ms | 2.80 ms |
2026-11-04 05:33:17 +09:00
Classic298 8957ac1397 fix: repeated warnings in the logs for MCP servers a user has not connected (#33663)
Every time a user loaded Open WebUI, each OAuth MCP server they had not connected yet wrote a warning to the logs ("No OAuth session found for user ..., client_id mcp:<server id>"), so instances with a few such servers filled their logs with it. Not having connected a server yet is a normal state, so the message now logs at debug level and only shows up when debug logging is on. Using an MCP server without connecting it still fails with "Auth required" as before.
2026-11-03 08:58:47 -05:00
Classic298 aa1326eaea fix: replies cut off at the token limit on a Responses API connection lose their token usage (#33619)
When a streamed reply from a Responses API connection stopped early, for example at the token limit or through a content filter, its token counts were lost. The chat showed no usage for that reply and the admin analytics recorded zero tokens for it. Such replies now keep the usage the provider reported, the same as replies that finished normally.

Fixes #33615
2026-11-03 21:04:51 +09:00
Classic298 dd6720c528 fix: non-ASCII stop sequences on a model reach the provider corrupted (#33614)
A Stop Sequence saved on a workspace model reached the provider corrupted when it had non-ASCII text in it (終 went out as çµ\x82, café as café), so the model never stopped on it. This happened when an API client used the model through /openai/chat/completions or /ollama/api/chat. Those stops now arrive unchanged, and typing \n in the field still sends a newline.

Fixes #33610
2026-11-03 20:44:05 +09:00
Classic298 1d5373066d fix: OpenTelemetry request metrics create a new series for each distinct URL (#33613)
With OpenTelemetry metrics on, a request for a URL the server has no API endpoint for was counted under its full address, so every distinct URL became a metric series of its own and the series count kept growing. When the web interface is not served (API-only setups) this happens for any unknown URL, such as bots probing for missing paths. With Starlette 1.3.1, the version pinned for source installs, it also happens for every page load, static file and websocket request, because that version tells the server nothing about which part of the app answered them. These requests are now counted without a URL label, while API requests keep theirs. Admins need to do nothing, as the old series stop growing and age out.

Fixes #33576
2026-11-03 20:43:51 +09:00
Timothy Jaeryang Baek 0c64e5d596 chore: format 2026-11-03 17:36:03 +09:00
Timothy Jaeryang Baek a8b478ed7b refac 2026-11-03 17:17:59 +09:00
Timothy Jaeryang Baek bab66b2c2f refac 2026-11-03 16:31:24 +09:00
Timothy Jaeryang Baek e789513ea6 refac 2026-11-03 16:25:23 +09:00
Timothy Jaeryang Baek f0cc1bb86e refac 2026-11-02 17:49:51 +09:00
Timothy Jaeryang Baek ddb43c83ba refac 2026-11-02 12:45:15 +09:00
Timothy Jaeryang Baek 47a9e7d48d refac 2026-11-02 12:09:54 +09:00
Timothy Jaeryang Baek 789a0f402a refac 2026-11-02 11:37:00 +09:00
Timothy Jaeryang Baek 321701c1af refac 2026-11-02 09:52:30 +09:00
Timothy Jaeryang Baek d99ec1c02c refac 2026-11-02 08:48:51 +09:00
Timothy Jaeryang Baek b51e68fbb3 refac 2026-11-02 00:31:46 +09:00
Timothy Jaeryang Baek 91241306e2 refac 2026-11-01 09:52:12 +09:00
Timothy Jaeryang Baek 3814b7b2f1 refac 2026-10-31 16:50:01 +09:00
Classic298 c9ee89467e feat: {{USER_ROLE}} prompt variable for the signed-in user's role (#33441)
Prompts could use the user's name and email but not their role, so role-aware system prompts needed a custom Filter function. Model system prompts, the user's own system prompt, saved prompts used with a slash command and chat requests through the API now replace {{USER_ROLE}} with the role, such as admin or user. Requested in #4765.
2026-10-31 07:47:17 +09:00
Timothy Jaeryang Baek 9d1b4ef362 refac 2026-10-30 16:01:47 +09:00
Timothy Jaeryang Baek 0e0ba872a4 refac 2026-10-30 07:50:55 +09:00