diff --git a/api/controllers/console/explore/installed_app.py b/api/controllers/console/explore/installed_app.py index 1483789750..c1fa1378ff 100644 --- a/api/controllers/console/explore/installed_app.py +++ b/api/controllers/console/explore/installed_app.py @@ -73,9 +73,12 @@ def _published_app_filter(): has_published_workflow = exists(select(Workflow.id).where(Workflow.id == App.workflow_id)) has_published_model_config = exists(select(AppModelConfig.id).where(AppModelConfig.id == App.app_model_config_id)) - return or_( - and_(App.mode.in_(workflow_app_modes), App.workflow_id.isnot(None), has_published_workflow), - and_(~App.mode.in_(workflow_app_modes), App.app_model_config_id.isnot(None), has_published_model_config), + return and_( + App.mode != AppMode.AGENT, + or_( + and_(App.mode.in_(workflow_app_modes), App.workflow_id.isnot(None), has_published_workflow), + and_(~App.mode.in_(workflow_app_modes), App.app_model_config_id.isnot(None), has_published_model_config), + ), ) diff --git a/api/tests/unit_tests/controllers/console/explore/test_installed_app.py b/api/tests/unit_tests/controllers/console/explore/test_installed_app.py index be6275b5cb..be85082ecd 100644 --- a/api/tests/unit_tests/controllers/console/explore/test_installed_app.py +++ b/api/tests/unit_tests/controllers/console/explore/test_installed_app.py @@ -64,6 +64,7 @@ class TestInstalledAppsListApi: assert "app_model_configs" in compiled_filter assert "workflow_id" in compiled_filter assert "app_model_config_id" in compiled_filter + assert "apps.mode != 'agent'" in compiled_filter def test_get_installed_apps( self, app: Flask, current_user: MagicMock, tenant_id: str, installed_app: MagicMock