From 667fd5cb8c6a0ee70b00e922cd82e4fcb12d8300 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 17 Aug 2026 08:12:16 +0000 Subject: [PATCH] fix: pass model_id at the tool-approval drain call site added upstream --- backend/open_webui/utils/middleware.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 426129d596..3363cdf59c 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -3262,15 +3262,10 @@ async def drain_approved_tool_calls(request, form_data, user, model, metadata) - if db_messages: assistant_message = await Chats.get_message_by_id_and_message_id(chat_id, message_id) if assistant_message: - db_messages.append( - { - k: v - for k, v in assistant_message.items() - if k in ('id', 'role', 'content', 'output', 'files', 'contextSummary', 'usage') - } - ) + db_messages.append({k: v for k, v in assistant_message.items() if k in PERSISTED_MESSAGE_KEYS}) form_data['messages'] = process_messages_with_output( db_messages, + model_id=model['id'], reasoning_format=get_reasoning_format(model), ) form_data['messages'] = sanitize_tool_pairs(form_data['messages'])