From 6763f767b9c3a54085776d38d5e758d2ba269ec8 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 13 Oct 2026 13:18:45 +0200 Subject: [PATCH] fix: automations never get memory tools or saved memories Chats started by an automation had no memory: the model got no memory tools and none of the owner's saved memories, even with Memory turned on, so asking it to list memories failed with a "Tool not found" error. Replying in that same chat worked, because the web UI passes the owner's Memory setting along with every message and automations did not. Automations that post into a chat now follow the owner's Memory setting like the web UI does, while the admin's Memories switch, the Memories permission and the model's Memory capability still apply. Channel automations still run without memory, so the owner's saved memories never show up in a channel other people can read. Fixes #32337 --- backend/open_webui/utils/automations.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/automations.py b/backend/open_webui/utils/automations.py index d27b766f93..fce8a6f45d 100644 --- a/backend/open_webui/utils/automations.py +++ b/backend/open_webui/utils/automations.py @@ -486,9 +486,22 @@ async def execute_automation(app, automation: AutomationModel) -> None: room=f'user:{automation.user_id}', ) + # Same fallback chain the chat UI uses to decide whether to send features.memory. + ui_settings = (user.settings.ui if user.settings else None) or {} + memory_setting = ui_settings.get('memory') + if memory_setting is None: + default_interface_settings = await Config.get('ui.default_interface_settings') or {} + memory_setting = default_interface_settings.get('memory') + if memory_setting is None: + memory_setting = await Config.get('memories.enable') + + model_defaults = await _resolve_model_defaults(app, model_id) + if memory_setting: + model_defaults['features'] = {**model_defaults.get('features', {}), 'memory': True} + # Build the same payload the frontend sends to /api/chat/completions form_data = { - **await _resolve_model_defaults(app, model_id), + **model_defaults, 'model': model_id, 'messages': [{'role': 'user', 'content': prompt}], 'stream': True,