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
This commit is contained in:
npc-nathan 2026-04-22 01:33:07 +01:00 • committed by GitHub
parent f162d4de90
commit 40011d72e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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'})