Commit Graph
261 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek cb19060e8f refac 2026-11-18 01:13:09 +09:00
Timothy Jaeryang Baek c201472cf8 refac 2026-11-17 19:31:57 +09:00
Classic298 139ca26f93 fix: a tool call that runs past the tool server timeout reaches the model as an empty error (#34119)
When a terminal command or a tool server call took longer than the tool server timeout (AIOHTTP_CLIENT_TIMEOUT_TOOL_SERVER), the model got `{"error": ""}` back as the tool result, with nothing saying what went wrong. It now gets `{"error": "TimeoutError"}`, which is also what Open WebUI already reports when reading a tool server's list of tools times out, so the model can tell the user that the call timed out.

Fixes #34096
2026-11-17 01:28:40 +09:00
Timothy Jaeryang Baek f22671e35a refac 2026-11-16 13:15:49 +09:00
Timothy Jaeryang Baek 4720ff19e7 refac 2026-11-13 17:36:00 +09:00
Timothy Jaeryang Baek 2547992b8a refac 2026-11-12 13:39:35 +09:00
Timothy Jaeryang Baek e46920dcc7 refac 2026-11-11 15:34:33 +09:00
Timothy Jaeryang Baek 28c5fba889 refac 2026-11-11 13:49:51 +09:00
Classic298 2c8fa823f3 feat: permission to limit sub-agents to specific users and groups (#34040)
Sub-agents could only be switched on or off for the whole instance, so once they were on every user could spawn them and an admin had no way to keep the extra model usage to a pilot group. The user permissions now have a Sub-agents switch under Features, both in the default permissions and in each group, next to Memories and working the same way. Users without the permission no longer get the sub-agent tool in their chats, nor the timer tool that is part of the same feature. Admins are not restricted by it, and with sub-agents off in Admin Settings nobody gets them, admins included. The permission is on by default, so existing instances behave as before until an admin turns it off; the default can also be set with the USER_PERMISSIONS_FEATURES_SUBAGENTS environment variable.

Closes #34038
2026-11-11 10:11:30 +09:00
Timothy Jaeryang Baek 6f2fc7bc7a refac 2026-11-10 21:18:18 +09:00
Timothy Jaeryang Baek 9b9bea514d refac 2026-11-08 19:06:43 +09:00
Classic298 071770989a fix: files and knowledge bases sent through the API reach the model again (#33815)
API clients that attach a file or knowledge collection in the files field of a chat completion got an answer to the bare question. File Context now defaults to off unless function calling is set to legacy, and API requests that do not come from a chat in the web UI get no tools to open the files either. File Context now defaults to on for those requests, so the file content is used in the answer as before. Chats in the web UI keep letting the model open the files itself.

Fixes #33808
2026-11-06 22:04:32 +09:00
Timothy Jaeryang Baek bd6fc15bee refac 2026-11-06 11:12:04 +09:00
Timothy Jaeryang Baek c16b77ba07 refac 2026-11-05 13:57:52 +09:00
Timothy Jaeryang Baek 404d27a36e refac 2026-11-05 11:41:25 +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
Timothy Jaeryang Baek 789a0f402a refac 2026-11-02 11:37:00 +09:00
Timothy Jaeryang Baek 91241306e2 refac 2026-11-01 09:52:12 +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
Timothy Jaeryang Baek f2cdbbebe3 refac 2026-10-29 16:39:42 +09:00
Classic298 2c64ab5487 fix: chat stops with no answer when an MCP server request fails mid-chat (#33272)
When an MCP tool server could not be reached for a tool call (server restarted, connection reset by a proxy or load balancer, a request timing out), the whole chat was cancelled as if the user had pressed stop, and the log only said "Task was cancelled!". Now only that tool call fails, the model gets the connection error as the tool result and the reply finishes, and the underlying connection error is logged. The MCP SDK cancels whatever task opened the session when a single request fails, so each MCP session now runs in its own task instead of the chat's.

Fixes #33268
2026-10-28 10:19:33 +09:00
Classic298 ee7c9ff5c1 fix: tool server tools change their schema on every restart and break prompt caching (#33000)
The required parameters of OpenAPI tool server tools, Open Terminal included, were sent to the model in a random order that could change every time Open WebUI restarted. The tool list sits at the start of every prompt, so a different order made every prefix cache on the model side miss, and long chats were processed again from scratch after a restart. The required parameters now keep the order the tool server declares, so the tool list stays identical across restarts.
2026-10-25 04:46:48 +09:00
G30 ab6976b5bf fix: when two tools have a function with the same name, the model can call both (#32670) 2026-10-21 02:25:31 +09:00
G30 fd1e59b25f fix: an array query parameter reaches an OpenAPI tool server as repeated values (#32677) 2026-10-21 02:18:13 +09:00
Classic298 51a4d58270 feat: tools come back on their own after all OpenAPI tool servers were unreachable (#32533)
With Redis, if every tool server was unreachable when Open WebUI loaded the tool server list, it cached an empty list and served it forever. The tools stayed missing from chats and the tool list after the servers came back, until a restart, a save in the tool server settings or a manual delete of the cached Redis key. An empty cached list is now only trusted while no OpenAPI tool server is enabled, so the next request that loads tools fetches the servers again, the same way terminal servers already behave. While an enabled server stays unreachable, each such request tries it again and can wait for its timeout.

Fixes #29573
2026-10-16 14:10:33 +04:00
Timothy Jaeryang Baek 97333a4697 refac 2026-10-13 20:04:28 +04:00
Timothy Jaeryang Baek 7840194631 refac 2026-10-13 19:51:58 +04:00
Timothy Jaeryang Baek d34f73066d refac 2026-10-13 19:10:21 +04:00
Timothy Jaeryang Baek 78613d86f7 refac 2026-10-11 15:55:57 +04:00
Timothy Jaeryang Baek c7b5edc726 refac 2026-10-10 23:50:29 +04:00
Timothy Jaeryang Baek d3acc2706d refac 2026-10-10 01:28:36 +04:00
Timothy Jaeryang Baek e6476928ee refac 2026-10-09 18:37:55 +04:00
Timothy Jaeryang Baek 9bbb95048b refac 2026-10-09 15:07:43 +04:00
Timothy Jaeryang Baek a20b622ba8 refac 2026-10-09 00:43:01 +04:00
Timothy Jaeryang Baek 93fc3fcb72 refac 2026-10-08 20:33:47 +04:00
Timothy Jaeryang Baek 55e1c44c94 refac 2026-10-07 17:18:05 +04:00
Timothy Jaeryang Baek d4c561d9f2 refac 2026-10-05 14:01:02 +04:00
Timothy Jaeryang Baek fb741ebcd2 refac 2026-10-05 10:56:06 +04:00
Timothy Jaeryang Baek f50f9e6252 refac 2026-10-01 03:31:20 +04:00
Classic298 c488f60e8b fix: temporary chats save sub-agent conversations on the server (#31573)
In a temporary chat, when the model handed a task to a sub-agent, the sub-agent's conversation with the task and its answer was saved on the server, although a temporary chat should leave nothing behind. The model is no longer offered sub-agents in temporary chats.

Fixes #31567
2026-09-30 19:05:21 +04:00
G30 702da1e471 fix: stop injecting memories and memory tools when memory is switched off (#30228) 2026-09-21 01:00:08 -04:00
Timothy Jaeryang Baek 3cda47cdb4 refac 2026-09-07 12:16:09 -04:00
Classic298 1932ca649e fix: stop sending OpenAPI tool server path and query parameters in the request body (#29717)
Tool calls to an OpenAPI tool server put every argument the model returned into the JSON request body, including the parameters that were already substituted into the URL. Servers that validate their input strictly (additionalProperties: false) answered 422 "unexpected property", so reads worked and every write through an endpoint with a path or query parameter failed.

The body is now built from the model's arguments minus the operation's declared parameters, keeping any name the requestBody schema declares as a property of its own, so an endpoint that wants the resource id in the body as well as in the path still gets it.

The filter only runs when the resolved body schema lists its properties. A free-form, composed or non-JSON body offers nothing to check a name against, so those requests go out exactly as before.

src/lib/apis/index.ts carries the same request builder for direct tool server connections and had the same bug, so it gets the same fix.

Fixes #29716
2026-09-06 17:01:26 -04:00
Timothy Jaeryang Baek 2140c189e1 refac 2026-08-31 00:05:34 -04:00
Timothy Jaeryang Baek 81b9afb731 refac 2026-08-31 00:03:51 -04:00
Timothy Jaeryang Baek 26f37426b7 refac 2026-08-30 12:09:34 -04:00
Timothy Jaeryang Baek 5c62cc0517 chore: format 2026-08-25 16:53:53 -04:00
Classic298 b1bfc18762 perf: cache the serialized builtin tool spec instead of deep-copying it per request (#28860)
Every chat request hands each builtin tool a fresh copy of its cached spec, because callers mutate what they get. That copy was a full deepcopy of a nested dict, repeated per tool per message.

The builder now caches the spec already serialized, so a request only parses it back. Parsing is what produces the independent tree callers mutate, and the cached value becomes an immutable string, so a request can no longer reach the cached object at all.

Measured on CPython 3.12 with a 1.1 KB spec and 20 builtin tools per request:

| | before | after |
|---|---|---|
| stdlib json, the default | 276.2 us | 66.4 us |
| orjson | 279.5 us | 37.5 us |

Builtin specs are plain JSON by construction: pydantic normalizes every default before it reaches the schema, so a tuple, set, enum or datetime cannot appear in one, and an unserializable default is dropped rather than embedded.
2026-08-25 16:00:34 -04:00
Timothy Jaeryang Baek 97466deea1 refac 2026-08-24 18:38:29 -04:00