From 40011d72e1d66aff2957c950f80d46ea33960b72 Mon Sep 17 00:00:00 2001 From: npc-nathan Date: Wed, 22 Apr 2026 01:33:07 +0100 Subject: [PATCH] fix: Correct model_id extraction from metadata for Automation in built-in tools Automation tool: Correctly extract model ID from __metadata__['model']['id'] instead of looking for non-existent model_id field --- backend/open_webui/tools/builtin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index afa3cb63a9..2887c2129d 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -2569,7 +2569,7 @@ async def create_automation( return json.dumps({'error': 'User not found'}) # Always use the calling model for the automation - model_id = (__metadata__ or {}).get('model_id') + model_id = (__metadata__ or {}).get('model', {}).get('id') if not model_id: return json.dumps({'error': 'Could not detect current model'})