From 31a09a1eeb1448d9f35ccab16bfd3b95cb9662f8 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sun, 27 Sep 2026 20:59:11 +0200 Subject: [PATCH] refac: check the owner's role before continuing a chat after a subagent finishes (#31451) The parent chat now only continues with a finished subagent's result while its owner still has a verified role, the same check timers already make. --- backend/open_webui/utils/subagents.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/subagents.py b/backend/open_webui/utils/subagents.py index 809dd601ae..13b9699216 100644 --- a/backend/open_webui/utils/subagents.py +++ b/backend/open_webui/utils/subagents.py @@ -14,7 +14,7 @@ from open_webui.models.chats import Chat, ChatForm, Chats from open_webui.models.config import Config from open_webui.models.users import UserModel, Users from open_webui.tasks import create_task, has_active_tasks -from open_webui.utils.auth import create_token +from open_webui.utils.auth import VERIFIED_USER_ROLES, create_token from open_webui.utils.json_codec import JSONCodec from open_webui.utils.misc import get_message_list from sqlalchemy import select @@ -84,7 +84,7 @@ async def process_pending_internal_messages( return user = await Users.get_user_by_id(user_id) - if not user: + if not user or user.role not in VERIFIED_USER_ROLES: return async with get_async_db() as db: