From 6ea7d06322bc2f59bd9fce5e06c3450016c2045c Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:37:33 +0100 Subject: [PATCH] fix: assistant could create automations past the limit when it gave no schedule (#35382) When an admin limits how many automations a user may have, a user at that limit could still get the assistant to create more, as long as it left out the schedule. The limit is now checked on every automation the assistant creates, with or without a schedule, exactly as on the Automations page. Admins stay unlimited. Fixes #35378 --- backend/open_webui/tools/builtin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/tools/builtin.py b/backend/open_webui/tools/builtin.py index 57be565bf5..ade93a9b3a 100644 --- a/backend/open_webui/tools/builtin.py +++ b/backend/open_webui/tools/builtin.py @@ -4551,10 +4551,14 @@ async def create_automation( (t.model_dump() if isinstance(t, BaseModel) else AutomationSchedule.model_validate(t).model_dump()) for t in triggers or [] ] - for i, trigger in enumerate(triggers): + try: + await check_automation_limits(__request__, user, None, None, is_create=True) + except HTTPException as e: + return JSONCodec.dumps({'error': e.detail}) + for trigger in triggers: try: await validate_rrule(trigger['rrule'], tz=user.timezone) - await check_automation_limits(__request__, user, trigger['rrule'], None, is_create=i == 0) + await check_automation_limits(__request__, user, trigger['rrule'], None) except ValueError as e: return JSONCodec.dumps({'error': f'Invalid schedule: {e}'}) except HTTPException as e: