diff --git a/src/backend/routers/tool.py b/src/backend/routers/tool.py index 78792cad66..6b375d982a 100644 --- a/src/backend/routers/tool.py +++ b/src/backend/routers/tool.py @@ -47,7 +47,7 @@ def list_tools( for tool in all_tools: # Tools with auth implementation can be enabled and visible but not accessible (e.g., if secrets are not set). # Therefore, we need to set is_auth_required for these types of tools as well for the frontend. - if (tool.is_available or tool.is_visible) and tool.auth_implementation is not None: + if (tool.is_available or tool.is_enabled) and tool.auth_implementation is not None: try: tool_auth_service = tool.auth_implementation() diff --git a/src/backend/services/auth/strategies/base.py b/src/backend/services/auth/strategies/base.py index e305545824..38112519a2 100644 --- a/src/backend/services/auth/strategies/base.py +++ b/src/backend/services/auth/strategies/base.py @@ -43,14 +43,13 @@ class BaseOAuthStrategy: def __init__(self, *args, **kwargs): self._post_init_check() - @classmethod - def _post_init_check(cls): + def _post_init_check(self): if any( [ - cls.NAME is None, + self.NAME is None, ] ): - raise ValueError(f"{cls.__name__} must have NAME attribute defined.") + raise ValueError(f"{self.__name__} must have NAME attribute defined.") @abstractmethod def get_client_id(self, **kwargs: Any): diff --git a/src/backend/tools/base.py b/src/backend/tools/base.py index f8bc62b32b..af5456b217 100644 --- a/src/backend/tools/base.py +++ b/src/backend/tools/base.py @@ -67,13 +67,12 @@ def __init__(self, *args, **kwargs): self._post_init_check() - @classmethod - def _post_init_check(cls): + def _post_init_check(self): if any( [ - cls.BACKEND_HOST is None, - cls.FRONTEND_HOST is None, - cls.AUTH_SECRET_KEY is None, + self.BACKEND_HOST is None, + self.FRONTEND_HOST is None, + self.AUTH_SECRET_KEY is None, ] ): raise ValueError( diff --git a/src/backend/tools/slack/tool.py b/src/backend/tools/slack/tool.py index 107afb6ddf..33f1471700 100644 --- a/src/backend/tools/slack/tool.py +++ b/src/backend/tools/slack/tool.py @@ -38,7 +38,7 @@ def get_tool_definition(cls) -> ToolDefinition: "required": True, } }, - is_enabled=True, + is_enabled=False, is_available=cls.is_available(), is_default_tool=False, is_background_tool=False,