From b2b0702eeaa80cdc62ca114bf4edabcb67446d65 Mon Sep 17 00:00:00 2001 From: DrMelone <27028174+Classic298@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:01:17 +0200 Subject: [PATCH] fix: guard JSON parsing on upload response for non-JSON success bodies --- backend/open_webui/tools/builtin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index fa8e02bc91..d7e1ec9c84 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -2965,7 +2965,10 @@ async def upload_file_to_terminal( return json.dumps( {'error': f'Upload failed (HTTP {response.status}): {detail}'} ) - result = await response.json() + try: + result = await response.json() + except Exception: + result = {} return json.dumps( {