From 0837f310be5fb46c114d563611acfabd41728678 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 17 Sep 2026 23:39:35 +0200 Subject: [PATCH 01/88] fix: reject Docling conversions that failed inside an HTTP 200 response (#30107) Uploading a file that Docling declines or fails to convert either dies with `TypeError: argument of type 'NoneType' is not iterable`, or silently succeeds and stores the literal string `` as the document's text, which then gets indexed and handed to the model as if it were the file. Docling returns the conversion outcome inside the HTTP 200 body, so checking only the HTTP status made a refused conversion look identical to a successful one, and the `errors` array that says why in plain words was never read. Failed and skipped conversions are now rejected with the messages Docling returned, so an unsupported format surfaces as "File format not allowed: example.dxf" and the traceback is gone. The markdown field is also read as nullable, because Docling returns JSON `null` for every content format it was not asked to produce, which any Docling Parameters setting `to_formats` without `md` will hit, and that null was what raised the TypeError. Successful conversions with empty markdown keep the existing `` placeholder, matching what TikaLoader and the Mistral loader already do in the same package. Fixes #29808 --- backend/open_webui/retrieval/loaders/main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/retrieval/loaders/main.py b/backend/open_webui/retrieval/loaders/main.py index 9188c723c1..e49faff051 100644 --- a/backend/open_webui/retrieval/loaders/main.py +++ b/backend/open_webui/retrieval/loaders/main.py @@ -290,8 +290,17 @@ class DoclingLoader: ) if r.ok: result = r.json() + # Docling reports failed and skipped conversions inside HTTP 200 responses. + conversion_status = result.get('status') + if conversion_status in ['failure', 'skipped']: + error_details = ( + '; '.join(filter(None, (error.get('error_message') for error in result.get('errors', [])))) + or 'no error message provided' + ) + raise Exception(f'Error calling Docling: conversion status {conversion_status} - {error_details}') + document_data = result.get('document', {}) - md_content = document_data.get('md_content', '') + md_content = document_data.get('md_content') or '' text = md_content or '' metadata = {'Content-Type': self.mime_type} if self.mime_type else {} From 460f2e76349c0aee730f710252f799eb1d6a9bf0 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 17 Sep 2026 23:39:43 +0200 Subject: [PATCH 02/88] fix: surface initial chat title generation failures in the log (#30106) When title generation for a brand new chat fails, the chat silently keeps the provisional title (the full first user message) and nothing is written to the log at the default level, so there is no way to tell that the feature is broken rather than disabled. The failure was caught by a broad `except Exception` and reported with `log.debug`, which is invisible unless GLOBAL_LOG_LEVEL is set to DEBUG. Issue #29533 describes an outage of this path that survived four releases for exactly that reason. This logs it with `log.exception` instead, matching how the rest of main.py reports background task failures, so an admin sees one ERROR line plus the traceback naming the real cause. Nothing else changes: the success path is untouched, the exception is still swallowed so the detached task cannot take anything down with it, and `background_tasks_handler` does not log this exception itself, so there is no duplicate traceback. Fixes #29533 --- backend/open_webui/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 5ce9aa542c..9324aca51c 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1464,8 +1464,8 @@ async def chat_completion( async def run_initial_title_generation(): try: await background_tasks_handler(title_ctx) - except Exception as e: - log.debug('Error generating initial chat title: %s', e) + except Exception: + log.exception('Error generating initial chat title') asyncio.create_task(run_initial_title_generation()) else: From d08b69025d49f310d087256e3e9580063ca0325f Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 17 Sep 2026 23:39:54 +0200 Subject: [PATCH 03/88] issue-template: require reproducing on latest AND dev right before submitting (#30104) Reports for bugs already fixed on dev, sometimes weeks earlier, are common because reporters check an old version once and never retest. Merges the two soft checkboxes into one strict, time-bound requirement and warns in the template body that unreproduced reports get closed without discussion. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 34663b5eda..510bdce1ba 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -12,6 +12,8 @@ body: Before submitting, search open and closed [Issues](https://github.com/open-webui/open-webui/issues) and [Discussions](https://github.com/open-webui/open-webui/discussions). The issue may already be reported or fixed on `dev`. + **Test on the latest release AND on `dev`, right before you submit this report, not last week.** A huge share of reports are for bugs already fixed on `dev`, sometimes weeks earlier, because the reporter only tested an old version and never rechecked. Reports that don't reproduce on latest and on current `dev` at submission time will be closed without further discussion, no exceptions. + Please do not open a code pull request for this report unless a maintainer asks for one, or the change is only i18n/localization. If you want to share code as reference, include it here as a local diff or patch. Actionable reproduction details are the most useful next step. Security vulnerabilities must not be reported publicly. Use the [GitHub security page](https://github.com/open-webui/open-webui/security) instead. @@ -23,12 +25,10 @@ body: options: - label: I searched open and closed issues and discussions for an existing report. required: true - - label: I checked whether this is already fixed on the `dev` branch or latest source. + - label: I reproduced this bug on the latest release AND on the current `dev` branch, right before submitting this report. I did not just check an old version or rely on a check from days ago. required: true - label: I understand that maintainers want a well-written issue before any code pull request. required: true - - label: I am using the latest available version of Open WebUI for my install method. - required: true - label: This is not a security vulnerability. required: true From 9923c53c10f754a79f92654ba4a78abb50bf5578 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 17 Sep 2026 23:40:07 +0200 Subject: [PATCH 04/88] fix: treat SVG uploads as documents instead of vision images (#30102) Uploading an .svg to a chat attached it as a vision image input, so the model received a data URI it could not decode. PIL-backed servers answered "cannot identify image file" and OpenAI answered "The image data you provided does not represent a valid image". No setting made it work. SVG now takes the ordinary file upload path, so its XML source is extracted and indexed and the model can answer questions about it. Rasterizing was the alternative and it would have discarded the part of an SVG a model reads best, the source itself. Raster formats are untouched and still go up as image inputs. A shared helper replaces the ad hoc image/ prefix checks at the points that decide image input versus document, on both ends. It normalises the content type first, because a stored "image/SVG+xml" or a trailing charset parameter slipped past a plain comparison. One behaviour change worth knowing: an SVG now needs the model to have the file upload capability, where before it rode in as an image. Fixes #30100 --- backend/open_webui/retrieval/loaders/main.py | 1 + backend/open_webui/utils/middleware.py | 5 +++-- backend/open_webui/utils/misc.py | 6 ++++++ src/lib/components/chat/Chat.svelte | 11 ++++++----- src/lib/components/chat/MessageInput.svelte | 7 ++++--- .../chat/MessageInput/InputMenu/Files.svelte | 4 +++- .../chat/MessageInput/QueuedMessageItem.svelte | 3 ++- src/lib/components/chat/Messages/UserMessage.svelte | 7 ++++--- src/lib/utils/index.ts | 5 +++++ 9 files changed, 34 insertions(+), 15 deletions(-) diff --git a/backend/open_webui/retrieval/loaders/main.py b/backend/open_webui/retrieval/loaders/main.py index e49faff051..74221f1aea 100644 --- a/backend/open_webui/retrieval/loaders/main.py +++ b/backend/open_webui/retrieval/loaders/main.py @@ -91,6 +91,7 @@ known_source_ext = [ 'yaml', 'yml', 'toml', + 'svg', ] known_archive_ext = {'docx', 'epub', 'odt', 'pptx', 'xlsx'} diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 5b59fbd7ad..472c74be1d 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -117,6 +117,7 @@ from open_webui.utils.misc import ( get_response_error_detail, get_reasoning_details, get_system_message, + is_raster_image_content_type, is_string_allowed, merge_system_messages, prepend_to_first_user_message_content, @@ -1725,7 +1726,7 @@ def get_images_from_messages(message_list): for file in message.get('files', []): if file.get('type') == 'image': message_images.append(file.get('url')) - elif file.get('content_type', '').startswith('image/'): + elif is_raster_image_content_type(file.get('content_type')): message_images.append(file.get('url')) if message_images: @@ -2440,7 +2441,7 @@ async def process_chat_payload(request, form_data, user, metadata, model): image_files = [ f for f in message.get('files', []) - if f.get('type') == 'image' or (f.get('content_type') or '').startswith('image/') + if f.get('type') == 'image' or is_raster_image_content_type(f.get('content_type')) ] if message.get('role') == 'user' and image_files: text_content = message.get('content', '') diff --git a/backend/open_webui/utils/misc.py b/backend/open_webui/utils/misc.py index 247ab72441..ad959d3bc7 100644 --- a/backend/open_webui/utils/misc.py +++ b/backend/open_webui/utils/misc.py @@ -1223,6 +1223,12 @@ def strict_match_mime_type(supported: list[str] | str, header: str) -> str | Non return None +def is_raster_image_content_type(content_type: str | None) -> bool: + """Return True if the content type is an image that decodes as a bitmap; SVG is XML.""" + base_content_type = (content_type or '').split(';')[0].strip().lower() + return base_content_type.startswith('image/') and base_content_type != 'image/svg+xml' + + def extract_urls(text: str) -> list[str]: # Regex pattern to match URLs url_pattern = re.compile(r'(https?://[^\s]+)', re.IGNORECASE) # Matches http and https URLs diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index a5df89c3a1..b966c3ef7b 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -64,7 +64,8 @@ removeAllDetails, getCodeBlockContents, displayFileHandler, - getUsageTokenCount + getUsageTokenCount, + isRasterImageContentType } from '$lib/utils'; import { AudioQueue } from '$lib/utils/audio'; import { createTemporaryChatId, isTemporaryChatId } from '$lib/utils/chatId'; @@ -2886,7 +2887,7 @@ ..._files.filter( (item) => ['doc', 'text', 'note', 'chat', 'folder', 'collection'].includes(item.type) || - (item.type === 'file' && !(item?.content_type ?? '').startsWith('image/')) + (item.type === 'file' && !isRasterImageContentType(item?.content_type)) ) ); chatFiles = chatFiles.filter( @@ -3323,7 +3324,7 @@ if (model) { const hasImages = createMessagesList(_history, parentId).some((message) => message.files?.some( - (file) => file.type === 'image' || (file?.content_type ?? '').startsWith('image/') + (file) => file.type === 'image' || isRasterImageContentType(file?.content_type) ) ); @@ -3445,7 +3446,7 @@ ...(userMessage?.files ?? []).filter( (item) => ['doc', 'text', 'note', 'chat', 'collection', 'folder'].includes(item.type) || - (item.type === 'file' && !(item?.content_type ?? '').startsWith('image/')) + (item.type === 'file' && !isRasterImageContentType(item?.content_type)) ) ); // Remove duplicates @@ -3496,7 +3497,7 @@ messages = messages .map((message) => { const imageFiles = (message?.files ?? []).filter( - (file) => file.type === 'image' || (file?.content_type ?? '').startsWith('image/') + (file) => file.type === 'image' || isRasterImageContentType(file?.content_type) ); if (message.output && message.role === 'assistant') { diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index d3cf5da88d..02988b0506 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -58,7 +58,8 @@ getUsageTokenCount, getUserPosition, getUserTimezone, - getWeekday + getWeekday, + isRasterImageContentType } from '$lib/utils'; import { uploadFile } from '$lib/apis/files'; import { getCwd, uploadNewFileToTerminal } from '$lib/apis/terminal'; @@ -1122,7 +1123,7 @@ return; } - if (file['type'].startsWith('image/')) { + if (isRasterImageContentType(file['type'])) { if (visionCapableModels.length === 0) { toast.error($i18n.t('Selected model(s) do not support image inputs')); return; @@ -1929,7 +1930,7 @@ dir={$settings?.chatDirection ?? 'auto'} > {#each files as file, fileIdx} - {#if file.type === 'image' || (file?.content_type ?? '').startsWith('image/')} + {#if file.type === 'image' || isRasterImageContentType(file?.content_type)} {@const fileUrl = file.url.startsWith('data') || file.url.startsWith('http') ? file.url diff --git a/src/lib/components/chat/MessageInput/InputMenu/Files.svelte b/src/lib/components/chat/MessageInput/InputMenu/Files.svelte index 4f0f495aaf..b387bc61d7 100644 --- a/src/lib/components/chat/MessageInput/InputMenu/Files.svelte +++ b/src/lib/components/chat/MessageInput/InputMenu/Files.svelte @@ -1,6 +1,8 @@
-

{$i18n.t('Database')}

+

+ {$i18n.t('settings.admin.db.title')} +

- + {#if showExternalDocumentLoaderHeadersHint}
@@ -667,8 +668,8 @@ {:else if RAGConfig.CONTENT_EXTRACTION_ENGINE === 'tika'}
@@ -689,8 +690,8 @@ {:else if RAGConfig.CONTENT_EXTRACTION_ENGINE === 'docling'}

- {$i18n.t('Leave empty for the built-in default.')} + {$i18n.t('settings.admin.subagents.systemPrompt.description')}

{/if} diff --git a/src/lib/components/admin/Settings/WebSearch.svelte b/src/lib/components/admin/Settings/WebSearch.svelte index 3570a03cde..f1cba10529 100644 --- a/src/lib/components/admin/Settings/WebSearch.svelte +++ b/src/lib/components/admin/Settings/WebSearch.svelte @@ -163,22 +163,24 @@ saveHandler(); }} > -

{$i18n.t('Web Search')}

+

+ {$i18n.t('settings.admin.web.title')} +

{#if webConfig} - +