Commit Graph
170 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 789a0f402a refac 2026-11-02 11:37:00 +09:00
Timothy Jaeryang Baek d99ec1c02c refac 2026-11-02 08:48:51 +09:00
Timothy Jaeryang Baek 91241306e2 refac 2026-11-01 09:52:12 +09:00
Timothy Jaeryang Baek 858c1e9665 chore: bump 2026-10-29 17:47:24 +09:00
Timothy Jaeryang Baek 44a9d499db refac 2026-10-29 17:39:31 +09:00
Timothy Jaeryang Baek ef29fb12f1 refac 2026-10-29 16:44:26 +09:00
Timothy Jaeryang Baek f2cdbbebe3 refac 2026-10-29 16:39:42 +09:00
Timothy Jaeryang Baek b34885efc6 refac 2026-10-28 10:02:45 +09:00
Timothy Jaeryang Baek b420726ff1 refac 2026-10-27 08:41:51 +09:00
Timothy Jaeryang Baek 4a10c093ab refac 2026-10-26 18:54:49 +09:00
Classic298andGitHub d378fe81cb fix: file viewer tools ignore the end line when no start line is given (#33154)
The view_file and view_knowledge_file built-in tools let a model ask for a start and end line, but passing only the end line did nothing: the tool returned the first block of characters and dropped the end line without a word. Models that asked for "up to line N" kept getting the same opening slice and no error, so they retried the call over and over. An end line on its own now reads from line 1 up to that line, the same result as passing start line 1 explicitly.

Fixes #33100
2026-10-25 00:08:51 -05:00
Classic298andGitHub a01b36afe8 fix: file reading tools skip text when paging with line numbers on (#33155)
When a model reads a file or knowledge-base file in pages with line numbers turned on, the position it was told to continue from pointed past the end of the previous page, so a chunk of text between pages was silently skipped and never returned. The gap grew with every page, dropping a few percent of a large file. Reading now continues from the right place and returns every character exactly once; paging with line numbers off is unchanged.

Fixes #33099
2026-10-24 23:59:39 -05:00
Timothy Jaeryang Baek 243ef36c49 refac 2026-10-21 09:53:09 +09:00
Classic298andGitHub 794e57cf7e fix: misleading ask_user error when questions are not sent as a list (#32727)
When a model sent the ask_user questions as anything other than a list, for example a JSON-encoded string, the tool answered "ask_user requires 1-3 questions." The model had sent the right number of questions, so it did not understand the error and often repeated the same call in a loop. It now gets a separate error saying the questions must be an array of question objects, and the count error only appears when the count is actually wrong.

Fixes #32662
2026-10-21 03:33:10 +09:00
Timothy Jaeryang Baek 92e64c1d59 refac 2026-10-16 14:31:39 +04:00
Timothy Jaeryang Baek 7b47c3b22c refac 2026-10-14 23:21:22 +04:00
Timothy Jaeryang Baek c314239558 refac 2026-10-14 17:10:08 +04:00
Timothy Jaeryang Baek 2e8839a5dd refac 2026-10-13 19:40:48 +04:00
Timothy Jaeryang Baek d34f73066d refac 2026-10-13 19:10:21 +04:00
Timothy Jaeryang Baek 200b951491 refac 2026-10-13 18:31:54 +04:00
Timothy Jaeryang Baek fc1005f09b refac 2026-10-13 18:16:01 +04:00
Classic298andGitHub 1369027db6 fix: external knowledge citation links lead to a not found error (#32233)
Clicking the title of a citation from an external knowledge base (Qdrant, Milvus, pgvector), or its Content link, opened a link to a file inside Open WebUI that does not exist, so the browser showed a not found error. These results are no longer treated as uploaded files, so when the citation's source is a web address both links open that page, and otherwise the title is plain text. This works whether or not the model uses native tool calling.

Fixes https://github.com/open-webui/open-webui/issues/32231
2026-10-12 11:57:07 +04:00
Timothy Jaeryang Baek 6affee4fce refac 2026-10-10 23:38:22 +04:00
Timothy Jaeryang BaekandTaylor Wilsdon 088830cf82 feat: Dynamic Tool Loading / Lazy Loading
Co-Authored-By: Taylor Wilsdon <6508528+taylorwilsdon@users.noreply.github.com>
2026-10-10 22:43:52 +04:00
G30andGitHub 94e9c7fef9 fix: show a knowledge file's current name in citations after it is renamed (#31860) 2026-10-10 20:44:43 +04:00
Timothy Jaeryang Baek d3acc2706d refac 2026-10-10 01:28:36 +04:00
Timothy Jaeryang Baek 9bbb95048b refac 2026-10-09 15:07:43 +04:00
Classic298andGitHub c04c7ddae0 fix: reranker gets no user info headers in chat and knowledge search (#32061)
With ENABLE_FORWARD_USER_INFO_HEADERS on and hybrid search enabled, rerank requests went out without the user headers when a chat searched attached knowledge, when a model used the built-in knowledge search tool, and when the collection query API was called with hybrid turned off for that one request. The embedding requests of the same search did carry them, so external rerankers that use these headers for per-user auth, rate limits or auditing saw anonymous calls. Rerank requests now carry the signed-in user, the same as embedding requests.

Fixes #32060
2026-10-08 16:55:45 +04:00
Timothy Jaeryang Baek d4c561d9f2 refac 2026-10-05 14:01:02 +04:00
Classic298andGitHub 52533c5675 refac: calendar event tools use the calendar's access check (#31537)
Editing or deleting a calendar event through the chat tools now checks access to the event's calendar the same way the calendar API does.
2026-09-30 19:29:19 +04:00
Timothy Jaeryang Baek 7ad0ae4687 refac 2026-09-24 12:34:04 -04:00
Timothy Jaeryang Baek 5fb869db22 refac 2026-09-21 08:59:39 -04:00
Timothy Jaeryang Baek 97e013a661 refac 2026-09-21 00:51:28 -04:00
Classic298andGitHub 7fa705f3b8 feat: let operators expose chosen file metadata to the model in retrieved sources (#29696)
Custom metadata attached to a file upload now reaches the vector DB, but the model still never sees it. Both prompt-assembly paths build their output from a fixed field set: the classic RAG <source> tag carries only id, name and resource type, and the retrieval tools return only content, source and file id per chunk. A scraper that records where each document came from therefore cannot get that origin in front of the model, so answers cannot state it.

RAG_SOURCE_METADATA_KEYS names the chunk metadata keys allowed through to the model. Configured keys are emitted as extra attributes on the <source> tag and as extra fields on tool result chunks, covering both retrieval paths. It is empty by default, so nothing changes for existing deployments.

An allowlist instead of passing everything through, because chunk metadata also carries file hashes, collection names, embedding config and relevance scores, which would then be added to every retrieved chunk of every request. Values are attacker-controllable through an uploaded file, so they are escaped before they go into the tag, and a configured key can never displace a field the tag or the chunk already defines.

Reported in open-webui/open-webui#29486.
2026-09-19 17:02:59 -05:00
Classic298andGitHub 1f8f1f61bb fix: tell ask_user models that the first option is shown as Recommended (#30196)
The ask_user card badges the first option of every question as "Recommended", but nothing ever told the model that. The model picks whatever order it likes, so the badge really means "listed first" and users act on a recommendation the model never made.

The ask_user tool description now states that the first option is labelled Recommended and that the model should list the option it recommends first, so the badge reflects an actual choice.

Kept the badge and instructed the model instead of adding a per-option "recommended" flag: the flag would need a schema change, validation in the request normalizer and a frontend change, for the same result in the common case. Dropping the badge was the other option, but it removes a useful affordance rather than fixing it.

Verified that the added line reaches the model by running the docstring through the tool-spec builder and checking the generated OpenAI function schema.

Fixes #30195
2026-09-19 09:59:18 -05:00
Timothy Jaeryang Baek d9c8de9c39 refac 2026-09-16 10:38:46 -04:00
Classic298andGitHub 3d6598fccb fix: steer models to replace_range in the replace_note_content tool description (#30048)
Asked to add a section or change a few lines, models answer with a whole-note
replace_note_content call and the rest of the note is gone, with nothing to
undo because the editor only records versions on chat inserts. The tool
already supports replace_range operations with an expected guard, but its
description never said when to use them or how the offsets work, so models
defaulted to sending the whole note back.

The docstring, which is the description every model receives for this tool
in note chats and normal chats alike, now states the preference for range
edits and the offset, overlap and expected rules the handler enforces.
Verified the text lands in the generated tool spec unchanged and that range
edits, the expected mismatch rejection and whole-note replace behave as
described against a sqlite data dir.
2026-09-15 22:51:49 -04:00
Timothy Jaeryang Baek e69236bccb refac 2026-09-13 23:33:22 -04:00
Classic298andGitHub 1b67da7004 feat: sort flags for kb_exec file listings (#29840)
kb_exec silently ignored ls -t. It accepted the flag, dropped it and
returned the same undefined database order as a plain ls, so the model
believed it had a newest-first list when it did not. With a few thousand
files in a knowledge base there was no way to ask what changed recently
without reading the whole listing and comparing dates by eye.

ls, tree and find now sort their file lines by name by default, so the
same knowledge base always lists the same way. -t sorts newest first,
-S largest first and -r reverses, combinable like -at or -tr, matching
the flags the model already knows from a shell. Directories keep their
existing name order and stay grouped first. No query changes: the
timestamps and sizes were already loaded for the date and size columns.
2026-09-09 12:30:47 -04:00
Classic298andGitHub 82f11b14c9 refac: run the built-in file grep off the event loop (#29621)
The built-in chat and knowledge grep tools awaited their matching helper directly, so the search ran on the event loop and held it for as long as the match took. Both call sites now hand the helper to a worker thread.

Output and error handling are unchanged: 17 cases (literal, regex, case-insensitive, count-only, no-match, invalid pattern, rejected quantifiers, missing file data, result truncation) compare byte-for-byte against the previous behaviour. The matcher's time budget lives in a contextvar, which asyncio.to_thread copies into the worker, so budget scoping still behaves as before.
2026-09-04 11:41:06 -04:00
Classic298andGitHub 8600b0564b fix: use raw strings for the regex escapes in the knowledge filesystem (#29515)
The regex detection helpers wrote their backslash escapes in ordinary string
literals, so Python reported six invalid escape sequences on import. They work
today because Python leaves an unrecognised escape as its two characters, but
that behaviour is deprecated and becomes a syntax error in a future release, at
which point the knowledge filesystem tools stop importing at all.

The literals are now raw, which is the same two characters with no warning.
Pattern detection and normalisation are unchanged: verified identical output
over every string up to length five drawn from the characters these helpers
look at.
2026-09-03 14:57:25 -04:00
Timothy Jaeryang Baek aeb126b95d refac 2026-08-30 23:46:02 -04:00
Timothy Jaeryang Baek 5c62cc0517 chore: format 2026-08-25 16:53:53 -04:00
Timothy Jaeryang Baek d5b66533e7 refac 2026-08-24 18:56:39 -04:00
Timothy Jaeryang Baek 9550731cc1 refac 2026-08-17 00:24:47 -07:00
54cefd2b99 fix: preserve complete user context in agentic retrieval (#27642)
* fix: preserve user info in agentic RAG tools

* fix: preserve user info in file access checks

---------

Co-authored-by: Damien SPINELLI <damien.spinelli@external.list.lu>
2026-08-17 00:56:48 -06:00
Timothy Jaeryang Baek 133549a87e refac 2026-08-13 18:19:25 -06:00
Timothy Jaeryang Baek 4465f52a3e refac 2026-08-13 18:13:43 -06:00
Timothy Jaeryang Baek 2649e3305c refac 2026-08-13 16:42:10 -06:00
Timothy Jaeryang Baek 90bb94abf9 refac 2026-08-12 18:13:47 -06:00