2273 Commits
Author SHA1 Message Date
Classic298 a4d385fff9 fix: API requests to Ollama models lose temperature, top_p, seed and other settings (#35612)
Sending temperature, top_p, top_k, seed, frequency_penalty, presence_penalty or max_completion_tokens to the chat completions API had no effect on Ollama models: the values were dropped and the model's saved settings were used instead. The same happened to temperature, top_p and top_k sent through the Anthropic messages API. Sent values now reach Ollama and the saved settings only fill in what the request left out, and max_completion_tokens wins when max_tokens is sent too.

Fixes #35607
2026-12-05 08:08:34 +04:00
Classic298 865d657770 perf: chat messages with attached files no longer read each file's full text to check access (#35619)
Checking whether someone may use a file read the whole file record from the database, including all of its extracted text, only to learn who owns it. This happened on every chat message for each attached document, again when a newly attached file was linked to the chat, and a second time on every file request by anyone other than the owner. Now only the owner is looked up. With a 400 KB document, the message that attaches it reads about 800 KB less from the database, every later message about 400 KB less, and opening a shared file reads half as much. Who can see which file does not change.

<table>
<tr><th>Database bytes read (400 KB of extracted text per file)</th><th>Before</th><th>After</th></tr>
<tr><td>Chat message that attaches one file</td><td>1,275 KB</td><td>467 KB</td></tr>
<tr><td>Opening a file shared with you</td><td>814 KB</td><td>410 KB</td></tr>
<tr><td>Refused file request</td><td>815 KB</td><td>412 KB</td></tr>
</table>
2026-12-05 08:08:13 +04:00
Classic298 99c747f48d fix: Local Open Terminal machines time out while starting in the Docker image (#35620)
Adding a Local (Experimental) machine in the official Docker image installed Open Terminal and even started it, then gave up after about 30 seconds with "server did not come up". The setup looked for its running server with a command the image does not include, so it never saw it. It now falls back to reading the system's process list directly, so the machine starts, restarts and stops normally there and on other systems that lack the ps command.

Fixes #35615
2026-12-05 08:07:36 +04:00
Classic298 7819514d39 fix: context compaction runs again on the next message when the model call right after a compaction fails (#35649)
When a long tool run compacted the chat partway through and the very next model call failed before returning anything, for example on a rate limit, the reply kept the token count from before the compaction. The next message then counted the chat as still over the threshold and compacted again. The next message now measures the history that is actually left after the summary, so it only compacts when that history is really over the threshold. A call that does answer after the compaction still uses the provider's own count as before.

Fixes #35644
2026-12-05 08:07:02 +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
Timothy Jaeryang Baek 7de92922fa refac 2026-12-05 06:57:35 +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 0d8eac0eb5 refac 2026-12-04 04:59:34 +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
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 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 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 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
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 076f6fb339 refac 2026-12-02 03:33:58 +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 4a51726230 refac 2026-12-01 01:58:55 +04:00
Timothy Jaeryang Baek 1c59e41e5f refac 2026-12-01 00:41:27 +04:00
Classic298 1e177c2bd0 refac: scope shared chat file lookup to the file owner (#35228)
Shared chats now only grant access to a file when the file owner owns the chat or attached the file to it.
2026-12-01 00:27:22 +04:00
Timothy Jaeryang Baek beed6b130e refac 2026-12-01 00:26:01 +04:00
Classic298 a658799f98 fix: failed OAuth picture fetch resets the user's picture to the default (#35389)
With the "Update Picture" setting turned on, any failure to fetch the picture from the identity provider (an outage, a 404, a URL the server refuses to fetch or an image type it does not accept) replaced the user's current picture with the default icon, and it stayed that way on every login until the fetch worked again. A failed fetch now keeps the current picture. A provider that sends no picture at all still resets it to the default, and a new user whose picture cannot be fetched still gets the default icon.

Fixes #35360
2026-12-01 00:23:17 +04:00
Classic298 c64032e714 fix: features read the attached-files list instead of what the user typed (#35192)
With native function calling, a saved chat with attachments put the list of attached files where features look for the user's message. The RAG template's {{QUERY}} slot, document search, memory search, the tool permission reviewer and the search queries for preloaded files got that list instead of what the user typed, and with an image attached the question was missing entirely. /skills:create was ignored whenever a file was attached. They now all use the user's own text, and the attachment list still reaches the model unchanged. With Preload files on, memory search and the reviewer still see the retrieved document text in front of the question, which is a separate problem.

Fixes #35163
Fixes #35195
2026-12-01 00:18:59 +04:00
Classic298 29589aa9ea fix: a tool server saved without a name shows as a blank row in the Tools menu (#35397)
Saving a tool server with the Name field left empty listed it in the chat's Tools menu with no text at all. An empty name now counts as no name, so an OpenAPI server shows the title from its spec and an MCP server shows "MCP Tool Server". A name you set still wins. Servers already saved without a name show correctly too, no need to save them again.

Fixes #33203
2026-12-01 00:18:17 +04:00
Classic298 926d43fb91 refac: scope model file lookup to the file owner (#35253)
Workspace models now only grant access to an attached knowledge file when the model owner owns that file, and the chat tools and the model's list of attached knowledge follow the same rule. Saving, re-importing or restoring a model only re-checks newly added files, so editors can keep working on models that already hold files.
2026-12-01 00:18:01 +04:00
Classic298 9985caee57 fix: some older chats fail on every new message with "'NoneType' object is not iterable" (#35390)
After upgrading to 0.13.5, some older chats fail on every new message with `'NoneType' object is not iterable` and the model is never asked. The upgrade keeps each earlier message exactly as it was stored, so a message saved with no value in its attachment field now hands that missing value back, and sending broke on it. A missing attachment value now counts as no attachments, so these chats work again without touching the database.

Fixes #35359
2026-12-01 00:06:05 +04:00
Classic298 e771f3eb75 fix: tool call through Tether hangs forever when the response is over 16 MiB (#35392)
When a tool on a computer connected through Tether returned more than 16 MiB, for example a large image, the tool call spun in the chat forever and the model never got an answer. Open WebUI rejected the oversized response and then tried to read it a second time, waiting for data that would never come. The tool call now fails right away with the "Response too large to buffer" error, which the model gets as the tool result.

Fixes #35207
2026-12-01 00:04:41 +04:00
Timothy Jaeryang Baek ca3b5c5156 refac 2026-11-30 23:15:45 +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
Timothy Jaeryang Baek 406fe308c0 refac 2026-11-30 22:49:49 +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
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 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 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
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 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