From 858c1e96652b99be9d730b487510ffbcc7be5f75 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 29 Oct 2026 17:47:24 +0900 Subject: [PATCH] chore: bump --- backend/open_webui/main.py | 4 +++- backend/open_webui/routers/notes.py | 5 ++--- backend/open_webui/tools/builtin.py | 4 +++- backend/open_webui/utils/middleware.py | 12 +++++++++--- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index ce3fe165a0..a1abf80e79 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1698,7 +1698,9 @@ async def chat_completion( async def emit_cancel_event(): if is_saved_chat_id(metadata.get('chat_id')) and metadata.get('message_id'): - async with Chats.edit_message_output(metadata['chat_id'], metadata['message_id']) as message: + async with Chats.edit_message_output( + metadata['chat_id'], metadata['message_id'] + ) as message: if message is not None: response_meta = dict(message.get('meta') or {}) response_meta.setdefault('response_ended_at', time.time()) diff --git a/backend/open_webui/routers/notes.py b/backend/open_webui/routers/notes.py index 7be91b2e61..04a447e96c 100644 --- a/backend/open_webui/routers/notes.py +++ b/backend/open_webui/routers/notes.py @@ -552,9 +552,8 @@ async def update_note_by_id( ): raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.DEFAULT()) - if ( - form_data.data - and not await has_access_to_note_files(note, get_content_files(form_data.data.get('content')), user, db=db) + if form_data.data and not await has_access_to_note_files( + note, get_content_files(form_data.data.get('content')), user, db=db ): raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail=ERROR_MESSAGES.DEFAULT()) diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index 3b3cb1591c..9e43578208 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -1601,7 +1601,9 @@ async def replace_note_content( update_data['title'] = title editor = await Users.get_user_by_id(__user__['id']) - if not editor or not await has_access_to_note_files(note, get_content_files(update_data['data']['content']), editor): + if not editor or not await has_access_to_note_files( + note, get_content_files(update_data['data']['content']), editor + ): return JSONCodec.dumps({'error': 'Cannot attach files you cannot access'}) form = NoteUpdateForm(**update_data) updated_note = await Notes.update_note_by_id(note_id, form) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 819349958d..b61635543b 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -4092,7 +4092,9 @@ async def non_streaming_chat_response_handler(response, ctx): # Save message in the database usage = normalize_usage(response_data.get('usage', {}) or {}) if continuing: - usage = merge_usage((ctx.get('assistant_message') or {}).get('usage'), usage or {'incomplete': True}) + usage = merge_usage( + (ctx.get('assistant_message') or {}).get('usage'), usage or {'incomplete': True} + ) finish_reason = choices[0].get('finish_reason') if choices else None if save_to_chat: @@ -4909,7 +4911,9 @@ async def streaming_chat_response_handler(response, ctx): # Normalize and capture usage for DB persistence if response_metadata.get('usage'): - current_usage = update_usage_snapshot(current_usage, response_metadata['usage']) + current_usage = update_usage_snapshot( + current_usage, response_metadata['usage'] + ) usage = merge_usage(prior_usage, current_usage) response_metadata['usage'] = usage @@ -5782,7 +5786,9 @@ async def streaming_chat_response_handler(response, ctx): for tool_call in response_tool_calls: tool_call_id = tool_call['call_id'] tool_function_name = tool_call.get('name', '') - tool_function_params, tool_result, tool, tool_type, direct_tool = tool_results[tool_call['call_id']] + tool_function_params, tool_result, tool, tool_type, direct_tool = tool_results[ + tool_call['call_id'] + ] if tool_result is None: results.append( { diff --git a/package-lock.json b/package-lock.json index 4670c22572..3f3d943f76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-webui", - "version": "0.12.4", + "version": "0.12.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-webui", - "version": "0.12.4", + "version": "0.12.5", "dependencies": { "@azure/msal-browser": "^4.5.0", "@codemirror/lang-javascript": "^6.2.2", diff --git a/package.json b/package.json index a4a960ee5a..f0e3149352 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.12.4", + "version": "0.12.5", "private": true, "scripts": { "crypto:verify": "node scripts/encryption/artifact.mjs",