AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(platform): Trigger On Anything (#12740)
Reinier van der Leerbef28d14e285
diff --git a/autogpt_platform/backend/backend/api/features/builder/db.py b/autogpt_platform/backend/backend/api/features/builder/db.pyindex 6f6a0cd34c..3ca1d34671 100644--- a/autogpt_platform/backend/backend/api/features/builder/db.py+++ b/autogpt_platform/backend/backend/api/features/builder/db.py@@ -294,6 +294,9 @@ async def _build_cached_search_results(search_term=search_query or None,page=1,page_size=MAX_LIBRARY_AGENT_RESULTS,+ # Hide trigger agents — they're parent-coupled, not+ # generally reusable as a sub-agent block.+ is_hidden=False,)total_items["my_agents"] = library_response.pagination.total_itemsscored_items.extend(diff --git a/autogpt_platform/backend/backend/api/features/chat/routes.py b/autogpt_platform/backend/backend/api/features/chat/routes.pyindex 58be141819..d8bd17f641 100644--- a/autogpt_platform/backend/backend/api/features/chat/routes.py+++ b/autogpt_platform/backend/backend/api/features/chat/routes.py@@ -59,6 +59,10 @@ from backend.copilot.response_model import ()from backend.copilot.service import strip_injected_context_for_displayfrom backend.copilot.tools.e2b_sandbox import kill_sandbox+from backend.copilot.tools.manage_schedules import (+ ScheduleDeletedResponse,+ ScheduleListResponse,+)from backend.copilot.tools.models import (AgentDetailsResponse,AgentOutputResponse,@@ -1562,6 +1566,8 @@ ToolResponseUnion = (| DocPageResponse| MCPToolsDiscoveredResponse| MCPToolOutputResponse+ | ScheduleListResponse+ | ScheduleDeletedResponse| MemoryStoreResponse| MemorySearchResponse| MemoryForgetCandidatesResponsediff --git a/autogpt_platform/backend/backend/api/features/library/db.py b/autogpt_platform/backend/backend/api/features/library/db.pyindex 0e21edf061..a169c55eef 100644--- a/autogpt_platform/backend/backend/api/features/library/db.py+++ b/autogpt_platform/backend/backend/api/features/library/db.py@@ -2,7 +2,7 @@ import asyncioimport itertoolsimport loggingfrom datetime import datetime, timezone-from typing import Literal, Optional+from typing import Literal, Optional, castimport fastapiimport prisma.errors@@ -112,6 +112,7 @@ async def list_library_agents(include_executions: bool = False,folder_id: Optional[str] = None,include_root_only: bool = False,+ is_hidden: Optional[bool] = None,) -> library_model.LibraryAgentResponse:"""Retrieves a paginated list of LibraryAgent records for a given user.@@ -160,6 +161,10 @@ async def list_library_agents(elif include_root_only and not search_term:where_clause["folderId"] = None+ # Apply isHidden filter+ if is_hidden is not None:+ where_clause["isHidden"] = is_hidden+# Build search filter if applicableif search_term:where_clause["OR"] = [@@ -494,6 +499,7 @@ async def create_library_agent(sensitive_action_safe_mode: bool = False,create_library_agents_for_sub_graphs: bool = True,folder_id: str | None = None,+ is_hidden: bool = False,) -> list[library_model.LibraryAgent]:"""Adds an agent to the user's library (LibraryAgent table).@@ -540,6 +546,7 @@ async def create_library_agent(data={"create": prisma.types.LibraryAgentCreateInput(isCreatedByUser=(user_id == graph.user_id),+ isHidden=is_hidden,useGraphIsActiveVersion=True,User={"connect": {"id": user_id}},AgentGraph={@@ -566,6 +573,7 @@ async def create_library_agent("update": {"isDeleted": False,"isArchived": False,+ "isHidden": is_hidden,"useGraphIsActiveVersion": True,"settings": SafeJson(GraphSettings.from_graph(@@ -667,6 +675,7 @@ async def create_graph_in_library(graph: graph_db.Graph,user_id: str,folder_id: str | None = None,+ is_hidden: bool = False,) -> tuple[graph_db.GraphModel, library_model.LibraryAgent]:"""Create a new graph and add it to the user's library."""graph.version = 1@@ -681,6 +690,7 @@ async def create_graph_in_library(sensitive_action_safe_mode=True,create_library_agents_for_sub_graphs=False,folder_id=folder_id,+ is_hidden=is_hidden,)if created_graph.is_active:@@ -761,6 +771,7 @@ async def update_library_agent(graph_version: Optional[int] = None,is_favorite: Optional[bool] = None,is_archived: Optional[bool] = None,+ is_hidden: Optional[bool] = None,is_deleted: Optional[Literal[False]] = None,settings: Optional[GraphSettings] = None,folder_id: Optional[str] = None,@@ -797,6 +808,8 @@ async def update_library_agent(update_fields["isFavorite"] = is_favoriteif is_archived is not None:update_fields["isArchived"] = is_archived+ if is_hidden is not None:+ update_fields["isHidden"] = is_hiddenif is_deleted is not None:if is_deleted is True:raise RuntimeError(@@ -1990,3 +2003,64 @@ async def fork_library_agent(sensitive_action_safe_mode=original_agent.settings.sensitive_action_safe_mode,))[0]+++# ── Trigger agents ──────────────────────────────────────────────────++_AGENT_EXECUTOR_BLOCK_ID = "e189baac-8c20-45a1-94a7-55177ea42565"+++async def list_trigger_agents(+ user_id: str,+ library_agent_id: str,+ *,+ parent_graph_id: Optional[str] = None,+) -> list[library_model.LibraryAgent]:+ """List trigger agents for the given parent library agent.++ Trigger agents are hidden LibraryAgents whose graph contains an+ AgentExecutorBlock node referencing the parent's graph_id. The+ relationship is derived from graph contents — no separate link+ table — so it stays consistent when triggers are edited.++ Pass ``parent_graph_id`` if the caller already has the parent+ loaded — skips the redundant ``get_library_agent`` lookup.+ """+ if parent_graph_id is None:+ parent = await get_library_agent(id=library_agent_id, user_id=user_id)+ parent_graph_id = parent.graph_id++ triggers, schedule_info = await asyncio.gather(+ prisma.models.LibraryAgent.prisma().find_many(+ where={+ "userId": user_id,+ "isHidden": True,+ "isDeleted": False,+ "isArchived": False,+ "AgentGraph": {+ "is": {+ "Nodes": {+ "some": {+ "agentBlockId": _AGENT_EXECUTOR_BLOCK_ID,+ "constantInput": cast(+ prisma.types.JsonFilter,+ {+ "path": ["graph_id"],+ "equals": prisma.Json(parent_graph_id),+ },+ ),+ }+ }+ }+ },+ },+ include=library_agent_include(+ user_id, include_nodes=False, include_executions=False+ ),+ ),+ _fetch_schedule_info(user_id),+ )+ return [+ library_model.LibraryAgent.from_db(t, schedule_info=schedule_info)+ for t in triggers+ ]diff --git a/autogpt_platform/backend/backend/api/features/library/db_test.py b/autogpt_platform/backend/backend/api/features/library/db_test.pyindex 562a0bfdfd..8e598f5ebd 100644--- a/autogpt_platform/backend/backend/api/features/library/db_test.py+++ b/autogpt_platform/backend/backend/api/features/library/db_test.py@@ -10,6 +10,7 @@ from backend.data.db import connectfrom backend.data.includes import library_agent_includefrom . import db+from . import model as library_model@pytest.mark.asyncio@@ -37,6 +38,7 @@ async def test_get_library_agents(mocker):isCreatedByUser=False,isDeleted=False,isArchived=False,+ isHidden=False,createdAt=datetime.now(),updatedAt=datetime.now(),isFavorite=False,@@ -88,6 +90,42 @@ async def test_get_library_agents(mocker):assert result.pagination.page_size == 50+ "is_hidden_arg, expected_in_where",+ [+ (False, False), # only non-hidden+ (True, True), # only hidden+ (None, "absent"), # all (no filter applied)+ ],+)+async def test_list_library_agents_is_hidden_filter(+ mocker, is_hidden_arg, expected_in_where+):+ """Verify the is_hidden tri-state correctly maps to the where clause:+ True/False set isHidden to that value, None omits the key entirely."""+ mock_agent_graph = mocker.patch("prisma.models.AgentGraph.prisma")+ mock_agent_graph.return_value.find_many = mocker.AsyncMock(return_value=[])++ mock_find_many = mocker.AsyncMock(return_value=[])+ mock_library_agent = mocker.patch("prisma.models.LibraryAgent.prisma")+ mock_library_agent.return_value.find_many = mock_find_many+ mock_library_agent.return_value.count = mocker.AsyncMock(return_value=0)++ mocker.patch(+ "backend.api.features.library.db._fetch_execution_counts",+ new=mocker.AsyncMock(return_value={}),+ )++ await db.list_library_agents("test-user", is_hidden=is_hidden_arg)++ where = mock_find_many.call_args.kwargs["where"]+ if expected_in_where == "absent":+ assert "isHidden" not in where+ else:+ assert where["isHidden"] is expected_in_where++@pytest.mark.asyncio(loop_scope="session")async def test_add_agent_to_library(mocker):await connect()@@ -130,6 +168,7 @@ async def test_add_agent_to_library(mocker):isCreatedByUser=False,isDeleted=False,isArchived=False,+ isHidden=False,createdAt=datetime.now(),updatedAt=datetime.now(),isFavorite=False,@@ -360,6 +399,44 @@ async def test_create_library_agent_uses_upsert():assert data["update"]["isArchived"] is False[email protected]("is_hidden", [True, False])+async def test_create_library_agent_preserves_is_hidden_in_upsert(is_hidden):+ """When create_library_agent is called with is_hidden, both branches+ of the upsert must persist that value — re-adding a soft-deleted+ trigger agent should keep it hidden, and creating a fresh hidden+ agent should land hidden in the DB."""+ mock_graph = MagicMock()+ mock_graph.id = "graph-1"+ mock_graph.version = 1+ mock_graph.user_id = "user-1"+ mock_graph.nodes = []+ mock_graph.sub_graphs = []++ @asynccontextmanager+ async def fake_tx():+ yield None++ with (+ patch("backend.api.features.library.db.transaction", fake_tx),+ patch("prisma.models.LibraryAgent.prisma") as mock_prisma,+ patch(+ "backend.api.features.library.db.add_generated_agent_image",+ new=AsyncMock(),+ ),+ patch(+ "backend.api.features.library.model.LibraryAgent.from_db",+ return_value=MagicMock(),+ ),+ ):+ mock_prisma.return_value.upsert = AsyncMock(return_value=MagicMock())+ await db.create_library_agent(mock_graph, "user-1", is_hidden=is_hidden)++ data = mock_prisma.return_value.upsert.call_args.kwargs["data"]+ assert data["create"]["isHidden"] is is_hidden+ assert data["update"]["isHidden"] is is_hidden++@pytest.mark.asyncioasync def test_list_favorite_library_agents(mocker):mock_library_agents = [@@ -372,6 +449,7 @@ async def test_list_favorite_library_agents(mocker):isCreatedByUser=False,isDeleted=False,isArchived=False,+ isHidden=False,createdAt=datetime.now(),updatedAt=datetime.now(),isFavorite=True,@@ -424,6 +502,7 @@ async def test_list_library_agents_skips_failed_agent(mocker):isCreatedByUser=False,isDeleted=False,isArchived=False,+ isHidden=False,createdAt=datetime.now(),updatedAt=datetime.now(),isFavorite=False,@@ -461,6 +540,247 @@ async def test_list_library_agents_skips_failed_agent(mocker):assert result.pagination.total_items == 1+async def test_list_trigger_agents_filters_by_parent_graph_id(mocker):+ """list_trigger_agents queries hidden LibraryAgents whose graph+ contains an AgentExecutorBlock node whose constantInput.graph_id+ matches the parent's graph_id. Verify the filter is wired up+ correctly — this is the load-bearing logic since the relationship+ is derived (no link table)."""+ parent_agent = library_model.LibraryAgent(+ id="parent-id",+ graph_id="parent-graph-id",+ graph_version=1,+ name="Parent",+ description="The parent",+ image_url=None,+ creator_name="",+ creator_image_url="",+ input_schema={"type": "object", "properties": {}},+ output_schema={"type": "object", "properties": {}},+ credentials_input_schema={"type": "object", "properties": {}},+ has_external_trigger=False,+ has_human_in_the_loop=False,+ has_sensitive_action=False,+ status=library_model.LibraryAgentStatus.COMPLETED,+ new_output=False,+ can_access_graph=True,+ is_latest_version=True,+ is_favorite=False,+ is_hidden=False,+ created_at=datetime.now(),+ updated_at=datetime.now(),+ )+ mocker.patch(+ "backend.api.features.library.db.get_library_agent",+ new=mocker.AsyncMock(return_value=parent_agent),+ )++ trigger_prisma = prisma.models.LibraryAgent(+ id="trig-1",+ userId="test-user",+ agentGraphId="trig-graph-id",+ settings="{}", # type: ignore+ agentGraphVersion=1,+ isCreatedByUser=True,+ isDeleted=False,+ isArchived=False,+ isHidden=True,+ createdAt=datetime.now(),+ updatedAt=datetime.now(),+ isFavorite=False,+ useGraphIsActiveVersion=True,+ AgentGraph=prisma.models.AgentGraph(+ id="trig-graph-id",+ version=1,+ name="Trigger Agent",+ description="Watches for new stuff",+ userId="test-user",+ isActive=True,+ createdAt=datetime.now(),+ ),+ )++ mock_find_many = mocker.AsyncMock(return_value=[trigger_prisma])+ mock_prisma = mocker.patch("prisma.models.LibraryAgent.prisma")+ mock_prisma.return_value.find_many = mock_find_many++ result = await db.list_trigger_agents(+ user_id="test-user", library_agent_id="parent-id"+ )++ assert len(result) == 1+ assert result[0].id == "trig-1"+ assert result[0].graph_id == "trig-graph-id"++ # Verify the where clause filters on the parent's graph_id via the+ # AgentExecutorBlock's constantInput JSON path — the core of the+ # derived-relationship query.+ where = mock_find_many.call_args.kwargs["where"]+ assert where["userId"] == "test-user"+ assert where["isHidden"] is True+ assert where["isDeleted"] is False+ assert where["isArchived"] is False+ nodes_some = where["AgentGraph"]["is"]["Nodes"]["some"]+ assert nodes_some["agentBlockId"] == db._AGENT_EXECUTOR_BLOCK_ID+ assert nodes_some["constantInput"]["path"] == ["graph_id"]+ assert nodes_some["constantInput"]["equals"] == prisma.Json("parent-graph-id")+++async def test_list_trigger_agents_skips_get_library_agent_when_parent_graph_id_passed(+ mocker,+):+ """When the caller passes parent_graph_id explicitly, the function+ must skip the redundant get_library_agent lookup and use the+ provided graph_id directly. Regression for a Sentry-flagged double+ lookup from list_agent_triggers."""+ get_lib_spy = mocker.patch(+ "backend.api.features.library.db.get_library_agent",+ new=mocker.AsyncMock(),+ )+ mock_find_many = mocker.AsyncMock(return_value=[])+ mock_prisma = mocker.patch("prisma.models.LibraryAgent.prisma")+ mock_prisma.return_value.find_many = mock_find_many+ mocker.patch(+ "backend.api.features.library.db._fetch_schedule_info",+ new=mocker.AsyncMock(return_value={}),+ )++ result = await db.list_trigger_agents(+ user_id="test-user",+ library_agent_id="parent-id",+ parent_graph_id="explicit-graph-id",+ )++ assert result == []+ get_lib_spy.assert_not_called()+ nodes_some = mock_find_many.call_args.kwargs["where"]["AgentGraph"]["is"]["Nodes"][+ "some"+ ]+ assert nodes_some["constantInput"]["equals"] == prisma.Json("explicit-graph-id")+++async def test_list_trigger_agents_propagates_schedule_info(mocker):+ """Trigger agents have schedules — _fetch_schedule_info must be+ called and its result threaded through LibraryAgent.from_db so the+ `is_scheduled` / `next_scheduled_run` fields are accurate.+ Regression for a Sentry finding."""+ parent_agent = library_model.LibraryAgent(+ id="parent-id",+ graph_id="parent-graph-id",+ graph_version=1,+ name="Parent",+ description="",+ image_url=None,+ creator_name="",+ creator_image_url="",+ input_schema={"type": "object", "properties": {}},+ output_schema={"type": "object", "properties": {}},+ credentials_input_schema={"type": "object", "properties": {}},+ has_external_trigger=False,+ has_human_in_the_loop=False,+ has_sensitive_action=False,+ status=library_model.LibraryAgentStatus.COMPLETED,+ new_output=False,+ can_access_graph=True,+ is_latest_version=True,+ is_favorite=False,+ is_hidden=False,+ created_at=datetime.now(),+ updated_at=datetime.now(),+ )+ mocker.patch(+ "backend.api.features.library.db.get_library_agent",+ new=mocker.AsyncMock(return_value=parent_agent),+ )++ trigger_prisma = prisma.models.LibraryAgent(+ id="trig-1",+ userId="test-user",+ agentGraphId="trig-graph-id",+ settings="{}", # type: ignore+ agentGraphVersion=1,+ isCreatedByUser=True,+ isDeleted=False,+ isArchived=False,+ isHidden=True,+ createdAt=datetime.now(),+ updatedAt=datetime.now(),+ isFavorite=False,+ useGraphIsActiveVersion=True,+ AgentGraph=prisma.models.AgentGraph(+ id="trig-graph-id",+ version=1,+ name="Trigger Agent",+ description="",+ userId="test-user",+ isActive=True,+ createdAt=datetime.now(),+ ),+ )+ mock_prisma = mocker.patch("prisma.models.LibraryAgent.prisma")+ mock_prisma.return_value.find_many = mocker.AsyncMock(return_value=[trigger_prisma])++ schedule_info = {"trig-graph-id": "2026-05-01T08:00:00+00:00"}+ schedule_spy = mocker.patch(+ "backend.api.features.library.db._fetch_schedule_info",+ new=mocker.AsyncMock(return_value=schedule_info),+ )++ result = await db.list_trigger_agents(+ user_id="test-user", library_agent_id="parent-id"+ )++ schedule_spy.assert_awaited_once_with("test-user")+ assert len(result) == 1+ assert result[0].is_scheduled is True+ assert result[0].next_scheduled_run is not None+++async def test_list_trigger_agents_returns_empty_when_no_triggers(mocker):+ """When the parent has no trigger agents, return an empty list+ rather than raising — the Triggers tab hides itself in that case."""+ parent_agent = library_model.LibraryAgent(+ id="parent-id",+ graph_id="parent-graph-id",+ graph_version=1,+ name="Parent",+ description="",+ image_url=None,+ creator_name="",+ creator_image_url="",+ input_schema={"type": "object", "properties": {}},+ output_schema={"type": "object", "properties": {}},+ credentials_input_schema={"type": "object", "properties": {}},+ has_external_trigger=False,+ has_human_in_the_loop=False,+ has_sensitive_action=False,+ status=library_model.LibraryAgentStatus.COMPLETED,+ new_output=False,+ can_access_graph=True,+ is_latest_version=True,+ is_favorite=False,+ is_hidden=False,+ created_at=datetime.now(),+ updated_at=datetime.now(),+ )+ mocker.patch(+ "backend.api.features.library.db.get_library_agent",+ new=mocker.AsyncMock(return_value=parent_agent),+ )++ mock_prisma = mocker.patch("prisma.models.LibraryAgent.prisma")+ mock_prisma.return_value.find_many = mocker.AsyncMock(return_value=[])++ result = await db.list_trigger_agents(+ user_id="test-user", library_agent_id="parent-id"+ )+ assert result == []++@pytest.mark.asyncioasync def test_fetch_execution_counts_empty_graph_ids():result = await db._fetch_execution_counts("user-1", [])diff --git a/autogpt_platform/backend/backend/api/features/library/model.py b/autogpt_platform/backend/backend/api/features/library/model.pyindex 8bd4a9edab..a5b25dd30d 100644--- a/autogpt_platform/backend/backend/api/features/library/model.py+++ b/autogpt_platform/backend/backend/api/features/library/model.py@@ -213,6 +213,8 @@ class LibraryAgent(pydantic.BaseModel):folder_id: str | None = Nonefolder_name: str | None = None # Denormalized for display+ is_hidden: bool = False+recommended_schedule_cron: str | None = Noneis_scheduled: bool = pydantic.Field(default=False,@@ -365,6 +367,7 @@ class LibraryAgent(pydantic.BaseModel):can_access_graph=can_access_graph,is_latest_version=is_latest_version,is_favorite=agent.isFavorite,+ is_hidden=agent.isHidden,folder_id=agent.folderId,folder_name=agent.Folder.name if agent.Folder else None,recommended_schedule_cron=agent.AgentGraph.recommendedScheduleCron,@@ -579,6 +582,10 @@ class LibraryAgentUpdateRequest(pydantic.BaseModel):is_archived: Optional[bool] = pydantic.Field(default=None, description="Archive the agent")+ is_hidden: Optional[bool] = pydantic.Field(+ default=None,+ description="Whether to hide the agent from the library listing",+ )settings: Optional[GraphSettings] = pydantic.Field(default=None, description="User-specific settings for this library agent")diff --git a/autogpt_platform/backend/backend/api/features/library/model_test.py b/autogpt_platform/backend/backend/api/features/library/model_test.pyindex 31924a1793..42f2b369ca 100644--- a/autogpt_platform/backend/backend/api/features/library/model_test.py+++ b/autogpt_platform/backend/backend/api/features/library/model_test.py@@ -21,6 +21,7 @@ def _make_library_agent(isCreatedByUser=True,isDeleted=False,isArchived=False,+ isHidden=False,createdAt=datetime.datetime.now(),updatedAt=datetime.datetime.now(),isFavorite=False,diff --git a/autogpt_platform/backend/backend/api/features/library/routes/agents.py b/autogpt_platform/backend/backend/api/features/library/routes/agents.pyindex b9c1cf1420..16f84534fb 100644--- a/autogpt_platform/backend/backend/api/features/library/routes/agents.py+++ b/autogpt_platform/backend/backend/api/features/library/routes/agents.py@@ -49,6 +49,13 @@ async def list_library_agents(False,description="Only return agents without a folder (root-level agents)",),+ is_hidden: Optional[bool] = Query(+ None,+ description=(+ "Filter by hidden status. True = only hidden, "+ "False = only non-hidden, omit = all agents."+ ),+ ),) -> library_model.LibraryAgentResponse:"""Get all agents in the user's library (both created and saved).@@ -61,6 +68,7 @@ async def list_library_agents(page_size=page_size,folder_id=folder_id,include_root_only=include_root_only,+ is_hidden=is_hidden,)@@ -177,6 +185,7 @@ async def update_library_agent(graph_version=payload.graph_version,is_favorite=payload.is_favorite,is_archived=payload.is_archived,+ is_hidden=payload.is_hidden,settings=payload.settings,folder_id=payload.folder_id,)@@ -208,3 +217,21 @@ async def fork_library_agent(library_agent_id=library_agent_id,user_id=user_id,)+++# ── Trigger agent endpoints ─────────────────────────────────────────+++ "/{library_agent_id}/triggers",+ summary="List Trigger Agents",+)+async def list_trigger_agents(+ library_agent_id: str,+ user_id: str = Security(autogpt_auth_lib.get_user_id),+) -> list[library_model.LibraryAgent]:+ """List trigger agents linked to the given parent agent."""+ return await library_db.list_trigger_agents(+ user_id=user_id,+ library_agent_id=library_agent_id,+ )diff --git a/autogpt_platform/backend/backend/api/features/library/routes_test.py b/autogpt_platform/backend/backend/api/features/library/routes_test.pyindex 935d9ec378..1136d99e6d 100644--- a/autogpt_platform/backend/backend/api/features/library/routes_test.py+++ b/autogpt_platform/backend/backend/api/features/library/routes_test.py@@ -115,6 +115,7 @@ async def test_get_library_agents_success(page_size=15,folder_id=None,include_root_only=False,+ is_hidden=None,)@@ -224,3 +225,50 @@ def test_add_agent_to_library_success(store_listing_version_id="test-version-id", user_id=test_user_id)mock_complete_onboarding.assert_awaited_once()+++async def test_list_trigger_agents_route(+ mocker: pytest_mock.MockFixture, test_user_id: str+) -> None:+ """GET /agents/{id}/triggers delegates to db.list_trigger_agents+ and returns the serialized LibraryAgent list."""+ trigger_agent = library_model.LibraryAgent(+ id="trigger-1",+ graph_id="trigger-graph",+ graph_version=1,+ name="Email Watcher",+ description="Watches the inbox",+ image_url=None,+ creator_name="",+ creator_image_url="",+ input_schema={"type": "object", "properties": {}},+ output_schema={"type": "object", "properties": {}},+ credentials_input_schema={"type": "object", "properties": {}},+ has_external_trigger=False,+ has_human_in_the_loop=False,+ has_sensitive_action=False,+ status=library_model.LibraryAgentStatus.COMPLETED,+ new_output=False,+ can_access_graph=True,+ is_latest_version=True,+ is_favorite=False,+ is_hidden=True,+ created_at=FIXED_NOW,+ updated_at=FIXED_NOW,+ )+ mock_db_call = mocker.patch("backend.api.features.library.db.list_trigger_agents")+ mock_db_call.return_value = [trigger_agent]++ response = client.get("/agents/parent-id/triggers")+ assert response.status_code == 200++ data = [library_model.LibraryAgent.model_validate(a) for a in response.json()]+ assert len(data) == 1+ assert data[0].id == "trigger-1"+ assert data[0].is_hidden is True++ mock_db_call.assert_called_once_with(+ user_id=test_user_id,+ library_agent_id="parent-id",+ )diff --git a/autogpt_platform/backend/backend/copilot/permissions.py b/autogpt_platform/backend/backend/copilot/permissions.pyindex 5531fdd5e9..638646f694 100644--- a/autogpt_platform/backend/backend/copilot/permissions.py+++ b/autogpt_platform/backend/backend/copilot/permissions.py@@ -82,6 +82,7 @@ ToolName = Literal["create_folder","customize_agent","delete_folder",+ "delete_schedule","delete_workspace_file","edit_agent","find_agent",@@ -93,7 +94,9 @@ ToolName = Literal["get_mcp_guide","get_platform_info","get_sub_session_result",+ "list_agent_triggers","list_folders",+ "list_schedules","list_workspace_files","memory_forget_confirm","memory_forget_search",diff --git a/autogpt_platform/backend/backend/copilot/sdk/agent_generation_guide.md b/autogpt_platform/backend/backend/copilot/sdk/agent_generation_guide.mdindex a0d6e6b1a1..7938929812 100644--- a/autogpt_platform/backend/backend/copilot/sdk/agent_generation_guide.md+++ b/autogpt_platform/backend/backend/copilot/sdk/agent_generation_guide.md@@ -324,3 +324,67 @@ A minimal agent with input, processing, and output:- Node 3: `AgentOutputBlock` (ID: `363ae599-353e-4804-937e-b2ee3cef3da4`,input_default: {"name": "summary", "title": "Summary"},input: "value" linked from Node 2's output)++### Building Trigger Agents++A **trigger agent** is a scheduled agent that watches for changes in an+external source (e.g. email inbox, RSS feed, API) and runs a parent agent+or AutoPilot session for each new item. Trigger agents are hidden from the+user's library but listed under the parent agent's triggers.++**Pattern: Fetch → Compare → Store → Sink**++1. **Fetch current state**: Use a data-fetching block (e.g. RSS, email,+ HTTP request) to get the latest items from the source.+2. **Retrieve stored state**: Use `RetrieveInformationBlock`+ (ID: `d8710fc9-6e29-481e-a7d5-165eb16f8471`) with scope `within_agent`+ to load the previously stored state (e.g. list of seen item IDs).+3. **Compare**: Use a `CodeExecutionBlock` to diff the fetched items+ against the stored state. Output the new items (if any).+4. **Store updated state**: Use `PersistInformationBlock`+ (ID: `1d055e55-a2b9-4547-8311-907d05b0304d`) with scope `within_agent`+ to save the current state for the next run.+5. **Sink** — for each new item, do one of:+ - **Run an agent**: Use `AgentExecutorBlock`+ (ID: `e189baac-8c20-45a1-94a7-55177ea42565`) to run the parent+ agent with the new item as input.+ - **Start an AutoPilot session**: Use `AutoPilotBlock`+ (ID: `c069dc6b-c3ed-4c12-b6e5-d47361e64ce6`) with a prompt+ describing the new item (e.g. "New email from {sender} about+ {subject}. Analyze and draft a reply.").++**Creating a trigger agent:**++1. Build the trigger agent JSON following the pattern above. When using+ the AgentExecutorBlock sink, set its `graph_id` (in `input_default`)+ to the parent agent's graph_id — this is how the trigger is linked+ to the parent agent.+2. Save it with `is_hidden=true` via `create_agent` so it doesn't+ clutter the user's library.+3. Schedule it to run on a cron interval (e.g. every 15 minutes:+ `*/15 * * * *`) using `run_agent` with `schedule_name` and `cron`.++The parent → trigger relationship is **derived from the graph+contents**: any hidden agent whose graph contains an AgentExecutorBlock+referencing the parent's graph_id is listed under that parent's+triggers. No explicit linking is needed.++**Inspecting an agent's existing triggers:**++- Use `list_agent_triggers` with the parent's `library_agent_id` to see+ all triggers configured for that agent — both trigger agents+ (`kind="agent"`) and webhook presets (`kind="webhook"`). Use this+ before adding a new trigger (to avoid duplicates) or before deleting+ one (to find the right ID).++**Managing schedules:**++- Use `list_schedules` to see existing schedules (optionally filtered by+ `graph_id`).+- Use `delete_schedule` with a `schedule_id` to remove one.+- To change a schedule's cron, delete it and re-create via `run_agent`+ with the new `cron`.++**Note**: When a trigger agent is edited and a new version is created,+the existing schedule will still run the old version. Delete the old+schedule and re-create it with the new version after editing.diff --git a/autogpt_platform/backend/backend/copilot/tools/__init__.py b/autogpt_platform/backend/backend/copilot/tools/__init__.pyindex a060e96346..68a5246bb2 100644--- a/autogpt_platform/backend/backend/copilot/tools/__init__.py+++ b/autogpt_platform/backend/backend/copilot/tools/__init__.py@@ -30,6 +30,7 @@ from .get_sub_session_result import GetSubSessionResultToolfrom .graphiti_forget import MemoryForgetConfirmTool, MemoryForgetSearchToolfrom .graphiti_search import MemorySearchToolfrom .graphiti_store import MemoryStoreTool+from .list_agent_triggers import ListAgentTriggersToolfrom .manage_folders import (CreateFolderTool,DeleteFolderTool,@@ -38,6 +39,7 @@ from .manage_folders import (MoveFolderTool,UpdateFolderTool,)+from .manage_schedules import DeleteScheduleTool, ListSchedulesToolfrom .platform_info import PlatformInfoToolfrom .run_agent import RunAgentToolfrom .run_block import RunBlockTool@@ -83,6 +85,11 @@ TOOL_REGISTRY: dict[str, BaseTool] = {"delete_folder": DeleteFolderTool(),"move_agents_to_folder": MoveAgentsToFolderTool(),"run_agent": RunAgentTool(),+ # Schedule management+ "list_schedules": ListSchedulesTool(),+ "delete_schedule": DeleteScheduleTool(),+ # Trigger discovery (parent agent → its triggers)+ "list_agent_triggers": ListAgentTriggersTool(),"run_block": RunBlockTool(),"continue_run_block": ContinueRunBlockTool(),"run_sub_session": RunSubSessionTool(),diff --git a/autogpt_platform/backend/backend/copilot/tools/agent_generator/core.py b/autogpt_platform/backend/backend/copilot/tools/agent_generator/core.pyindex 593b0d3d44..ddec3d14d2 100644--- a/autogpt_platform/backend/backend/copilot/tools/agent_generator/core.py+++ b/autogpt_platform/backend/backend/copilot/tools/agent_generator/core.py@@ -222,6 +222,9 @@ async def get_library_agents_for_generation(page=1,page_size=max_results,include_executions=True,+ # Hide trigger agents — they aren't reusable as sub-agents+ # (parent-coupled, single-purpose).+ is_hidden=False,)results: list[LibraryAgentSummary] = []@@ -599,6 +602,7 @@ async def save_agent_to_library(user_id: str,is_update: bool = False,folder_id: str | None = None,+ is_hidden: bool = False,) -> tuple[Graph, Any]:"""Save agent to database and user's library.@@ -607,6 +611,7 @@ async def save_agent_to_library(user_id: User IDis_update: Whether this is an update to an existing agentfolder_id: Optional folder ID to place the agent in+ is_hidden: Whether the agent should be hidden from library listingReturns:Tuple of (created Graph, LibraryAgent)@@ -615,7 +620,9 @@ async def save_agent_to_library(db = library_db()if is_update:return await db.update_graph_in_library(graph, user_id)- return await db.create_graph_in_library(graph, user_id, folder_id=folder_id)+ return await db.create_graph_in_library(+ graph, user_id, folder_id=folder_id, is_hidden=is_hidden+ )def graph_to_json(graph: Graph) -> dict[str, Any]:diff --git a/autogpt_platform/backend/backend/copilot/tools/agent_generator/pipeline.py b/autogpt_platform/backend/backend/copilot/tools/agent_generator/pipeline.pyindex f2a4b95b77..194b068043 100644--- a/autogpt_platform/backend/backend/copilot/tools/agent_generator/pipeline.py+++ b/autogpt_platform/backend/backend/copilot/tools/agent_generator/pipeline.py@@ -54,6 +54,7 @@ async def fix_validate_and_save(save_message: str | None = None,library_agents: list[dict[str, Any]] | None = None,folder_id: str | None = None,+ is_hidden: bool = False,) -> ToolResponseBase:"""Shared pipeline: auto-fix → validate → preview or save.@@ -172,7 +173,11 @@ async def fix_validate_and_save(try:created_graph, library_agent = await save_agent_to_library(- agent_json, user_id, is_update=is_update, folder_id=folder_id+ agent_json,+ user_id,+ is_update=is_update,+ folder_id=folder_id,+ is_hidden=is_hidden,)return AgentSavedResponse(message=(diff --git a/autogpt_platform/backend/backend/copilot/tools/agent_search.py b/autogpt_platform/backend/backend/copilot/tools/agent_search.pyindex 011b2d7565..d6f43d391e 100644--- a/autogpt_platform/backend/backend/copilot/tools/agent_search.py+++ b/autogpt_platform/backend/backend/copilot/tools/agent_search.py@@ -141,6 +141,10 @@ async def _search_library(user_id=user_id,search_term=query or None,page_size=50 if not query else 10,+ # Hide trigger agents — they aren't reusable as sub-agents+ # (parent-coupled, single-purpose). AutoPilot accesses+ # them via list_agent_triggers instead.+ is_hidden=False,)for agent in results.agents:agents.append(_library_agent_to_info(agent))diff --git a/autogpt_platform/backend/backend/copilot/tools/create_agent.py b/autogpt_platform/backend/backend/copilot/tools/create_agent.pyindex a27392fc8e..815888370a 100644--- a/autogpt_platform/backend/backend/copilot/tools/create_agent.py+++ b/autogpt_platform/backend/backend/copilot/tools/create_agent.py@@ -56,6 +56,16 @@ class CreateAgentTool(BaseTool):"type": "string","description": "Folder ID to save into (default: root).",},+ "is_hidden": {+ "type": "boolean",+ "description": (+ "Hide from the user's library listing. "+ "Use for trigger agents — they appear under "+ "the parent agent's triggers (auto-derived "+ "from AgentExecutorBlock usage in the graph)."+ ),+ "default": False,+ },},"required": ["agent_json"],}@@ -68,6 +78,7 @@ class CreateAgentTool(BaseTool):save: bool = True,library_agent_ids: list[str] | None = None,folder_id: str | None = None,+ is_hidden: bool = False,**kwargs,) -> ToolResponseBase:session_id = session.session_id if session else None@@ -92,7 +103,9 @@ class CreateAgentTool(BaseTool):nodes = agent_json.get("nodes", [])if not nodes:return ErrorResponse(- message="The agent JSON has no nodes. An agent needs at least one block.",+ message=(+ "The agent JSON has no nodes. " "An agent needs at least one block."+ ),error="empty_agent",session_id=session_id,)@@ -117,4 +130,5 @@ class CreateAgentTool(BaseTool):default_name="Generated Agent",library_agents=library_agents,folder_id=folder_id,+ is_hidden=is_hidden,)diff --git a/autogpt_platform/backend/backend/copilot/tools/create_agent_test.py b/autogpt_platform/backend/backend/copilot/tools/create_agent_test.pyindex 5bf32342a4..245233ee20 100644--- a/autogpt_platform/backend/backend/copilot/tools/create_agent_test.py+++ b/autogpt_platform/backend/backend/copilot/tools/create_agent_test.py@@ -1,6 +1,6 @@"""Tests for CreateAgentTool."""-from unittest.mock import MagicMock, patch+from unittest.mock import AsyncMock, MagicMock, patchimport pytest@@ -131,6 +131,48 @@ async def test_local_mode_validation_failure(tool, session):assert "Block 'bad-block' not found" in result.details["errors"][email protected]("is_hidden", [True, False])+async def test_is_hidden_passes_through_to_pipeline(tool, session, is_hidden):+ """The is_hidden param on create_agent must reach+ fix_validate_and_save unchanged so trigger agents land in the DB+ hidden. Regression for an earlier review finding that the kwarg+ plumbing was untested."""+ agent_json = {+ "name": "Trigger Watcher",+ "nodes": [+ {+ "id": "node-1",+ "block_id": "block-1",+ "input_default": {},+ "metadata": {"position": {"x": 0, "y": 0}},+ }+ ],+ "links": [],+ }++ mock_fix = MagicMock(name="fix_validate_and_save_result")+ with (+ patch(+ "backend.copilot.tools.create_agent.fetch_library_agents",+ new=AsyncMock(return_value=[]),+ ),+ patch(+ "backend.copilot.tools.create_agent.fix_validate_and_save",+ new=AsyncMock(return_value=mock_fix),+ ) as mock_fix_validate,+ ):+ await tool._execute(+ user_id=_TEST_USER_ID,+ session=session,+ agent_json=agent_json,+ is_hidden=is_hidden,+ )++ mock_fix_validate.assert_awaited_once()+ assert mock_fix_validate.call_args.kwargs["is_hidden"] is is_hidden++@pytest.mark.asyncioasync def test_local_mode_no_auth_returns_error(tool, session):"""Local mode with save=true and no user returns ErrorResponse."""diff --git a/autogpt_platform/backend/backend/copilot/tools/get_agent_building_guide.py b/autogpt_platform/backend/backend/copilot/tools/get_agent_building_guide.pyindex c11dff2d7d..3d263a7930 100644--- a/autogpt_platform/backend/backend/copilot/tools/get_agent_building_guide.py+++ b/autogpt_platform/backend/backend/copilot/tools/get_agent_building_guide.py@@ -5,12 +5,19 @@ from pathlib import Pathfrom typing import Anyfrom backend.copilot.model import ChatSession+from backend.util.feature_flag import Flag, is_feature_enabledfrom .base import BaseToolfrom .models import ErrorResponse, ResponseType, ToolResponseBaselogger = logging.getLogger(__name__)+# Heading title (without the ``### ``) used to drop the trigger-agents+# section when the generic-trigger-agents feature flag is off. Keep+# this string in sync with the heading in agent_generation_guide.md —+# the guide-gating test locks both branches.+_TRIGGER_AGENTS_HEADING = "Building Trigger Agents"+_GUIDE_CACHE: str | None = None@@ -70,6 +77,15 @@ class GetAgentBuildingGuideTool(BaseTool):session_id = session.session_id if session else Nonetry:content = _load_guide()+ triggers_enabled = (+ await is_feature_enabled(+ Flag.GENERIC_TRIGGER_AGENTS, user_id, default=False+ )+ if user_id+ else False+ )+ if not triggers_enabled:+ content = _strip_h3_section(content, _TRIGGER_AGENTS_HEADING)return AgentBuildingGuideResponse(message="Agent building guide loaded.",content=content,@@ -82,3 +98,26 @@ class GetAgentBuildingGuideTool(BaseTool):error=str(e),session_id=session_id,)+++def _strip_h3_section(guide: str, heading: str) -> str:+ """Remove a single ``### {heading}`` section from the guide.++ The section runs from its ``### `` heading up to (but not+ including) the next H2/H3 heading, or end-of-file if it's the+ last section. Sections after the stripped one are preserved —+ future additions to the guide aren't silently dropped.+ """+ lines = guide.split("\n")+ target = f"### {heading}"+ out: list[str] = []+ skipping = False+ for line in lines:+ if line == target:+ skipping = True+ continue+ if skipping and line.startswith(("# ", "## ", "### ")):+ skipping = False+ if not skipping:+ out.append(line)+ return "\n".join(out)diff --git a/autogpt_platform/backend/backend/copilot/tools/get_agent_building_guide_test.py b/autogpt_platform/backend/backend/copilot/tools/get_agent_building_guide_test.pyindex 261247ee72..d4d7a48f9f 100644--- a/autogpt_platform/backend/backend/copilot/tools/get_agent_building_guide_test.py+++ b/autogpt_platform/backend/backend/copilot/tools/get_agent_building_guide_test.py@@ -1,6 +1,15 @@"""Tests for GetAgentBuildingGuideTool."""-from backend.copilot.tools.get_agent_building_guide import _load_guide+import pytest++from backend.copilot.model import ChatSession+from backend.copilot.tools.get_agent_building_guide import (+ _TRIGGER_AGENTS_HEADING,+ GetAgentBuildingGuideTool,+ _load_guide,+ _strip_h3_section,+)+from backend.copilot.tools.models import ResponseTypedef test_load_guide_returns_string():@@ -13,3 +22,93 @@ def test_load_guide_caches():guide1 = _load_guide()guide2 = _load_guide()assert guide1 is guide2+++def test_guide_contains_trigger_agents_heading():+ """Sanity check: the heading sentinel used to gate the trigger-agents+ section must actually appear in the guide. If this fails, either the+ heading was renamed or the section was removed — update the sentinel+ in get_agent_building_guide.py to match."""+ guide = _load_guide()+ assert f"\n### {_TRIGGER_AGENTS_HEADING}" in guide+++def test_strip_h3_section_preserves_following_sections():+ """A future H3 section appended after the gated one must survive+ the strip — that's the whole reason the gating is section-aware+ rather than strip-to-EOF."""+ guide = "\n".join(+ [+ "## Title",+ "",+ "### First Section",+ "",+ "alpha",+ "",+ "### Building Trigger Agents",+ "",+ "secret",+ "",+ "### Future Section",+ "",+ "beta",+ ]+ )+ stripped = _strip_h3_section(guide, "Building Trigger Agents")+ assert "alpha" in stripped+ assert "secret" not in stripped+ assert "Building Trigger Agents" not in stripped+ assert "### Future Section" in stripped+ assert "beta" in stripped+++def test_strip_h3_section_no_op_when_heading_missing():+ """Stripping a missing heading is a no-op (defensive — guards+ against the heading being renamed without the sentinel updated)."""+ guide = "## Title\n\n### Only Section\n\ncontent"+ assert _strip_h3_section(guide, "Building Trigger Agents") == guide+++def _make_session(user_id: str = "user-1") -> ChatSession:+ return ChatSession.new(user_id=user_id, dry_run=False)+++async def test_guide_includes_trigger_section_when_flag_enabled(mocker):+ mocker.patch(+ "backend.copilot.tools.get_agent_building_guide.is_feature_enabled",+ new=mocker.AsyncMock(return_value=True),+ )+ tool = GetAgentBuildingGuideTool()+ result = await tool._execute(user_id="user-1", session=_make_session())+ assert result.type == ResponseType.AGENT_BUILDER_GUIDE+ assert "Building Trigger Agents" in result.content # type: ignore[attr-defined]+++async def test_guide_strips_trigger_section_when_flag_disabled(mocker):+ mocker.patch(+ "backend.copilot.tools.get_agent_building_guide.is_feature_enabled",+ new=mocker.AsyncMock(return_value=False),+ )+ tool = GetAgentBuildingGuideTool()+ result = await tool._execute(user_id="user-1", session=_make_session())+ assert result.type == ResponseType.AGENT_BUILDER_GUIDE+ assert "Building Trigger Agents" not in result.content # type: ignore[attr-defined]+ # Pre-trigger content (e.g. block-ID examples) must still be present.+ assert "AgentExecutorBlock" in result.content # type: ignore[attr-defined]+++async def test_guide_strips_trigger_section_when_no_user_id(mocker):+ """Anonymous CoPilot calls (no user_id) must not see the trigger+ section — there's no user context to evaluate the flag against, so+ default to off."""+ spy = mocker.patch(+ "backend.copilot.tools.get_agent_building_guide.is_feature_enabled",+ new=mocker.AsyncMock(return_value=True),+ )+ tool = GetAgentBuildingGuideTool()+ result = await tool._execute(user_id=None, session=_make_session())+ assert "Building Trigger Agents" not in result.content # type: ignore[attr-defined]+ spy.assert_not_called()diff --git a/autogpt_platform/backend/backend/copilot/tools/list_agent_triggers.py b/autogpt_platform/backend/backend/copilot/tools/list_agent_triggers.pynew file mode 100644index 0000000000..f59e4f14a5--- /dev/null+++ b/autogpt_platform/backend/backend/copilot/tools/list_agent_triggers.py@@ -0,0 +1,177 @@+"""Tool for listing all triggers (trigger agents + webhook presets) for an agent."""++import asyncio+import logging+from typing import Any, Literal++from pydantic import BaseModel++from backend.api.features.library.db import (+ get_library_agent,+ list_presets,+ list_trigger_agents,+)+from backend.copilot.model import ChatSession+from backend.util.exceptions import NotFoundError++from .base import BaseTool+from .models import ErrorResponse, ResponseType, ToolResponseBase++logger = logging.getLogger(__name__)+++class AgentTriggerInfo(BaseModel):+ """Single trigger configured for a parent library agent.++ Two kinds: ``agent`` for a hidden trigger agent that runs on a+ schedule and invokes the parent (Fetch→Compare→Store→Sink pattern),+ and ``webhook`` for a webhook-triggered preset that fires the+ parent on incoming HTTP events. ``id`` identifies the trigger for+ follow-up actions: library_agent_id for ``agent`` (use to delete or+ edit the trigger agent), preset_id for ``webhook``.+ """++ kind: Literal["agent", "webhook"]+ id: str+ name: str+ description: str = ""++ # Agent-trigger only.+ graph_id: str | None = None+ is_scheduled: bool | None = None+ next_scheduled_run: str | None = None++ # Webhook-trigger only.+ is_active: bool | None = None+ webhook_id: str | None = None+++class AgentTriggerListResponse(ToolResponseBase):+ """Response listing all triggers (agent + webhook) for a parent agent."""++ type: ResponseType = ResponseType.AGENT_TRIGGER_LIST+ triggers: list[AgentTriggerInfo]+++class ListAgentTriggersTool(BaseTool):+ """List all triggers configured for a parent library agent.++ Returns both kinds of triggers: hidden trigger agents (scheduled+ fetch→compare→store→sink graphs that invoke the parent) and webhook+ presets (HTTP events that fire the parent directly). Use this+ before deleting a trigger or to show the user what's already set up.+ """++ @property+ def name(self) -> str:+ return "list_agent_triggers"++ @property+ def description(self) -> str:+ return (+ "List triggers (agents + webhook presets) for a library agent. "+ "Use before delete or to show what's set up."+ )++ @property+ def requires_auth(self) -> bool:+ return True++ @property+ def parameters(self) -> dict[str, Any]:+ return {+ "type": "object",+ "properties": {+ "library_agent_id": {+ "type": "string",+ "description": "Parent library agent ID.",+ },+ },+ "required": ["library_agent_id"],+ }++ async def _execute(+ self,+ user_id: str | None,+ session: ChatSession,+ **kwargs,+ ) -> ToolResponseBase:+ session_id = session.session_id if session else None+ if not user_id:+ return ErrorResponse(+ message="Authentication required.",+ error="auth_required",+ session_id=session_id,+ )++ library_agent_id: str | None = kwargs.get("library_agent_id")+ if not library_agent_id:+ return ErrorResponse(+ message="library_agent_id is required.",+ error="missing_argument",+ session_id=session_id,+ )++ try:+ parent = await get_library_agent(id=library_agent_id, user_id=user_id)+ except NotFoundError as e:+ return ErrorResponse(+ message=f"Library agent not found: {e}",+ error="library_agent_not_found",+ session_id=session_id,+ )++ # Pass parent_graph_id so list_trigger_agents skips its own+ # get_library_agent call (we already loaded the parent above).+ # Both queries can run concurrently since they don't depend+ # on each other once we have the parent's graph_id.+ trigger_agents, preset_response = await asyncio.gather(+ list_trigger_agents(+ user_id=user_id,+ library_agent_id=library_agent_id,+ parent_graph_id=parent.graph_id,+ ),+ list_presets(+ user_id=user_id,+ page=1,+ page_size=100,+ graph_id=parent.graph_id,+ ),+ )+ webhook_presets = [+ p for p in preset_response.presets if p.webhook_id is not None+ ]++ triggers: list[AgentTriggerInfo] = [+ AgentTriggerInfo(+ kind="agent",+ id=ta.id,+ name=ta.name,+ description=ta.description or "",+ graph_id=ta.graph_id,+ is_scheduled=ta.is_scheduled,+ next_scheduled_run=ta.next_scheduled_run,+ )+ for ta in trigger_agents+ ] + [+ AgentTriggerInfo(+ kind="webhook",+ id=p.id,+ name=p.name,+ description=p.description or "",+ is_active=p.is_active,+ webhook_id=p.webhook_id,+ )+ for p in webhook_presets+ ]++ message = (+ f"Found {len(triggers)} trigger(s) for this agent."+ if triggers+ else "No triggers configured."+ )+ return AgentTriggerListResponse(+ message=message,+ triggers=triggers,+ session_id=session_id,+ )diff --git a/autogpt_platform/backend/backend/copilot/tools/manage_schedules.py b/autogpt_platform/backend/backend/copilot/tools/manage_schedules.pynew file mode 100644index 0000000000..adf0269875--- /dev/null+++ b/autogpt_platform/backend/backend/copilot/tools/manage_schedules.py@@ -0,0 +1,218 @@+"""Tools for listing and deleting agent execution schedules."""++import logging+from typing import Any++from pydantic import BaseModel++from backend.api.features.library.db import get_library_agent+from backend.copilot.model import ChatSession+from backend.util.clients import get_scheduler_client+from backend.util.exceptions import NotAuthorizedError, NotFoundError++from .base import BaseTool+from .models import ErrorResponse, ResponseType, ToolResponseBase++logger = logging.getLogger(__name__)+++class ScheduleSummary(BaseModel):+ """Summary of a single schedule."""++ schedule_id: str+ name: str+ cron: str+ timezone: str+ next_run_time: str+ graph_id: str+ graph_version: int+++class ScheduleListResponse(ToolResponseBase):+ """Response containing a list of schedules."""++ type: ResponseType = ResponseType.SCHEDULE_LIST+ schedules: list[ScheduleSummary]+++class ScheduleDeletedResponse(ToolResponseBase):+ """Response confirming a schedule was deleted."""++ type: ResponseType = ResponseType.SCHEDULE_DELETED+ schedule_id: str+++class ListSchedulesTool(BaseTool):+ """List the user's existing scheduled agent executions.++ Use this to find a schedule before deleting it, or to show the user+ which schedules they currently have set up. Optionally filter by+ graph_id to list schedules for a specific agent.+ """++ @property+ def name(self) -> str:+ return "list_schedules"++ @property+ def description(self) -> str:+ return "List agent run schedules. Use before delete_schedule."++ @property+ def requires_auth(self) -> bool:+ return True++ @property+ def parameters(self) -> dict[str, Any]:+ return {+ "type": "object",+ "properties": {+ "library_agent_id": {+ "type": "string",+ "description": "Filter by library agent.",+ },+ "graph_id": {+ "type": "string",+ "description": "Filter by graph.",+ },+ },+ "required": [],+ }++ async def _execute(+ self,+ user_id: str | None,+ session: ChatSession,+ **kwargs,+ ) -> ToolResponseBase:+ session_id = session.session_id if session else None+ if not user_id:+ return ErrorResponse(+ message="Authentication required.",+ error="auth_required",+ session_id=session_id,+ )++ library_agent_id: str | None = kwargs.get("library_agent_id")+ graph_id: str | None = kwargs.get("graph_id")++ # Resolve library_agent_id → graph_id (also verifies ownership)+ if library_agent_id:+ try:+ lib_agent = await get_library_agent(+ id=library_agent_id, user_id=user_id+ )+ except NotFoundError as e:+ return ErrorResponse(+ message=f"Library agent not found: {e}",+ error="library_agent_not_found",+ session_id=session_id,+ )+ graph_id = lib_agent.graph_id++ jobs = await get_scheduler_client().get_execution_schedules(+ graph_id=graph_id,+ user_id=user_id,+ )++ schedules = [+ ScheduleSummary(+ schedule_id=job.id,+ name=job.name,+ cron=job.cron,+ timezone=job.timezone,+ next_run_time=job.next_run_time,+ graph_id=job.graph_id,+ graph_version=job.graph_version,+ )+ for job in jobs+ ]++ message = (+ f"Found {len(schedules)} schedule(s)."+ if schedules+ else "No schedules found."+ )+ return ScheduleListResponse(+ message=message,+ schedules=schedules,+ session_id=session_id,+ )+++class DeleteScheduleTool(BaseTool):+ """Delete an agent run schedule.++ Use list_schedules first to find the schedule_id.+ """++ @property+ def name(self) -> str:+ return "delete_schedule"++ @property+ def description(self) -> str:+ return "Delete an agent run schedule by schedule_id."++ @property+ def requires_auth(self) -> bool:+ return True++ @property+ def parameters(self) -> dict[str, Any]:+ return {+ "type": "object",+ "properties": {+ "schedule_id": {+ "type": "string",+ "description": "Schedule ID from list_schedules.",+ },+ },+ "required": ["schedule_id"],+ }++ async def _execute(+ self,+ user_id: str | None,+ session: ChatSession,+ **kwargs,+ ) -> ToolResponseBase:+ session_id = session.session_id if session else None+ if not user_id:+ return ErrorResponse(+ message="Authentication required.",+ error="auth_required",+ session_id=session_id,+ )++ schedule_id: str | None = kwargs.get("schedule_id")+ if not schedule_id:+ return ErrorResponse(+ message="schedule_id is required.",+ error="missing_schedule_id",+ session_id=session_id,+ )++ try:+ await get_scheduler_client().delete_schedule(+ schedule_id=schedule_id,+ user_id=user_id,+ )+ except NotFoundError as e:+ return ErrorResponse(+ message=f"Schedule not found: {e}",+ error="schedule_not_found",+ session_id=session_id,+ )+ except NotAuthorizedError as e:+ return ErrorResponse(+ message=f"Not authorized: {e}",+ error="not_authorized",+ session_id=session_id,+ )++ return ScheduleDeletedResponse(+ message=f"Schedule {schedule_id} deleted.",+ schedule_id=schedule_id,+ session_id=session_id,+ )diff --git a/autogpt_platform/backend/backend/copilot/tools/manage_schedules_test.py b/autogpt_platform/backend/backend/copilot/tools/manage_schedules_test.pynew file mode 100644index 0000000000..c55f3224be--- /dev/null+++ b/autogpt_platform/backend/backend/copilot/tools/manage_schedules_test.py@@ -0,0 +1,215 @@+"""Tests for ListSchedulesTool and DeleteScheduleTool."""++from unittest.mock import AsyncMock, MagicMock, patch++import pytest++from backend.copilot.tools.manage_schedules import (+ DeleteScheduleTool,+ ListSchedulesTool,+ ScheduleDeletedResponse,+ ScheduleListResponse,+)+from backend.copilot.tools.models import ErrorResponse++from ._test_data import make_session++_USER = "test-user-schedules"+_SCHEDULES_PATH = "backend.copilot.tools.manage_schedules"+++def list_tool():+ return ListSchedulesTool()+++def delete_tool():+ return DeleteScheduleTool()+++def session():+ return make_session(_USER)+++# ── ListSchedulesTool ──────────────────────────────────────────────+++async def test_list_schedules_no_auth(list_tool, session):+ result = await list_tool._execute(user_id=None, session=session)+ assert isinstance(result, ErrorResponse)+ assert result.error == "auth_required"+++async def test_list_schedules_returns_results(list_tool, session):+ mock_job = MagicMock(spec=[])+ mock_job.id = "sched-1"+ mock_job.name = "My Schedule"+ mock_job.cron = "*/5 * * * *"+ mock_job.timezone = "UTC"+ mock_job.next_run_time = "2026-04-13T12:00:00"+ mock_job.graph_id = "graph-1"+ mock_job.graph_version = 1+ mock_client = AsyncMock()+ mock_client.get_execution_schedules = AsyncMock(return_value=[mock_job])++ with patch(+ f"{_SCHEDULES_PATH}.get_scheduler_client",+ return_value=mock_client,+ ):+ result = await list_tool._execute(user_id=_USER, session=session)++ assert isinstance(result, ScheduleListResponse)+ assert len(result.schedules) == 1+ assert result.schedules[0].schedule_id == "sched-1"+ assert result.schedules[0].cron == "*/5 * * * *"+++async def test_list_schedules_empty(list_tool, session):+ mock_client = AsyncMock()+ mock_client.get_execution_schedules = AsyncMock(return_value=[])++ with patch(+ f"{_SCHEDULES_PATH}.get_scheduler_client",+ return_value=mock_client,+ ):+ result = await list_tool._execute(user_id=_USER, session=session)++ assert isinstance(result, ScheduleListResponse)+ assert len(result.schedules) == 0+ assert "No schedules" in result.message+++async def test_list_schedules_by_library_agent(list_tool, session):+ mock_agent = MagicMock(graph_id="graph-42")+ mock_client = AsyncMock()+ mock_client.get_execution_schedules = AsyncMock(return_value=[])++ with (+ patch(+ f"{_SCHEDULES_PATH}.get_library_agent",+ new_callable=AsyncMock,+ return_value=mock_agent,+ ),+ patch(+ f"{_SCHEDULES_PATH}.get_scheduler_client",+ return_value=mock_client,+ ),+ ):+ result = await list_tool._execute(+ user_id=_USER,+ session=session,+ library_agent_id="lib-agent-1",+ )++ assert isinstance(result, ScheduleListResponse)+ mock_client.get_execution_schedules.assert_called_once_with(+ graph_id="graph-42", user_id=_USER+ )+++async def test_list_schedules_library_agent_not_found(list_tool, session):+ from backend.util.exceptions import NotFoundError++ with patch(+ f"{_SCHEDULES_PATH}.get_library_agent",+ new_callable=AsyncMock,+ side_effect=NotFoundError("not found"),+ ):+ result = await list_tool._execute(+ user_id=_USER,+ session=session,+ library_agent_id="missing",+ )++ assert isinstance(result, ErrorResponse)+ assert result.error == "library_agent_not_found"+++# ── DeleteScheduleTool ─────────────────────────────────────────────+++async def test_delete_schedule_no_auth(delete_tool, session):+ result = await delete_tool._execute(user_id=None, session=session)+ assert isinstance(result, ErrorResponse)+ assert result.error == "auth_required"+++async def test_delete_schedule_missing_id(delete_tool, session):+ result = await delete_tool._execute(user_id=_USER, session=session)+ assert isinstance(result, ErrorResponse)+ assert result.error == "missing_schedule_id"+++async def test_delete_schedule_success(delete_tool, session):+ mock_client = AsyncMock()+ mock_client.delete_schedule = AsyncMock()++ with patch(+ f"{_SCHEDULES_PATH}.get_scheduler_client",+ return_value=mock_client,+ ):+ result = await delete_tool._execute(+ user_id=_USER,+ session=session,+ schedule_id="sched-1",+ )++ assert isinstance(result, ScheduleDeletedResponse)+ assert result.schedule_id == "sched-1"+ mock_client.delete_schedule.assert_called_once_with(+ schedule_id="sched-1", user_id=_USER+ )+++async def test_delete_schedule_not_found(delete_tool, session):+ from backend.util.exceptions import NotFoundError++ mock_client = AsyncMock()+ mock_client.delete_schedule = AsyncMock(side_effect=NotFoundError("Job not found"))++ with patch(+ f"{_SCHEDULES_PATH}.get_scheduler_client",+ return_value=mock_client,+ ):+ result = await delete_tool._execute(+ user_id=_USER,+ session=session,+ schedule_id="missing",+ )++ assert isinstance(result, ErrorResponse)+ assert result.error == "schedule_not_found"+++async def test_delete_schedule_not_authorized(delete_tool, session):+ from backend.util.exceptions import NotAuthorizedError++ mock_client = AsyncMock()+ mock_client.delete_schedule = AsyncMock(+ side_effect=NotAuthorizedError("wrong user")+ )++ with patch(+ f"{_SCHEDULES_PATH}.get_scheduler_client",+ return_value=mock_client,+ ):+ result = await delete_tool._execute(+ user_id=_USER,+ session=session,+ schedule_id="sched-1",+ )++ assert isinstance(result, ErrorResponse)+ assert result.error == "not_authorized"diff --git a/autogpt_platform/backend/backend/copilot/tools/models.py b/autogpt_platform/backend/backend/copilot/tools/models.pyindex 03084d1e4a..a416f60674 100644--- a/autogpt_platform/backend/backend/copilot/tools/models.py+++ b/autogpt_platform/backend/backend/copilot/tools/models.py@@ -42,6 +42,13 @@ class ResponseType(str, Enum):BLOCK_OUTPUT = "block_output"REVIEW_REQUIRED = "review_required"+ # Schedules+ SCHEDULE_LIST = "schedule_list"+ SCHEDULE_DELETED = "schedule_deleted"++ # Agent triggers+ AGENT_TRIGGER_LIST = "agent_trigger_list"+# MCPMCP_GUIDE = "mcp_guide"MCP_TOOLS_DISCOVERED = "mcp_tools_discovered"diff --git a/autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py b/autogpt_platform/backend/backend/copilot/tools/tool_schema_test.pyindex ae1b9a715b..0bd0ceabc0 100644--- a/autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py+++ b/autogpt_platform/backend/backend/copilot/tools/tool_schema_test.py@@ -36,7 +36,12 @@ from backend.copilot.tools import TOOL_REGISTRY# for parity with the Claude Code SDK's built-in (PR #12879). The new# schema adds ~600 chars; description already trimmed to the minimum# viable copy.-_CHAR_BUDGET = 34_000+# Bumped 34000 -> 35000 on PR #12740 for the schedule management tools+# (list_schedules, delete_schedule) needed by the trigger-agent flow.+# Bumped 35000 -> 35500 on PR #12740 for the list_agent_triggers tool+# (returns trigger agents + webhook presets for a parent agent so+# AutoPilot can inspect/manage them).+_CHAR_BUDGET = 35_500@pytest.fixture(scope="module")diff --git a/autogpt_platform/backend/backend/util/feature_flag.py b/autogpt_platform/backend/backend/util/feature_flag.pyindex ae795fe988..ede10cab1a 100644--- a/autogpt_platform/backend/backend/util/feature_flag.py+++ b/autogpt_platform/backend/backend/util/feature_flag.py@@ -47,6 +47,7 @@ class Flag(str, Enum):COPILOT_TIER_WORKSPACE_STORAGE_LIMITS = "copilot-tier-workspace-storage-limits"COPILOT_TIER_STRIPE_PRICES = "copilot-tier-stripe-prices"GRAPHITI_MEMORY = "graphiti-memory"+ GENERIC_TRIGGER_AGENTS = "generic-trigger-agents"# Stripe Product ID for top-up Checkout sessions. When unset (default),# top_up_intent uses inline product_data (creates ephemeral Stripe products# per Checkout). When set to a real Stripe Product ID, line items referencediff --git a/autogpt_platform/backend/migrations/20260402120000_add_library_agent_is_hidden/migration.sql b/autogpt_platform/backend/migrations/20260402120000_add_library_agent_is_hidden/migration.sqlnew file mode 100644index 0000000000..634b0eac5b--- /dev/null+++ b/autogpt_platform/backend/migrations/20260402120000_add_library_agent_is_hidden/migration.sql@@ -0,0 +1,8 @@+-- Add isHidden flag to LibraryAgent for trigger agents.+-- Trigger agents are hidden from the main library listing; their parent+-- agents are derived from AgentExecutorBlock usage in the trigger graph.+ALTER TABLE "LibraryAgent" ADD COLUMN "isHidden" BOOLEAN NOT NULL DEFAULT false;++-- Index for filtering by hidden status in library listings.+-- All library list queries filter on (userId, isDeleted, isArchived, isHidden).+CREATE INDEX "LibraryAgent_isHidden_idx" ON "LibraryAgent" ("userId", "isHidden") WHERE "isDeleted" = false AND "isArchived" = false;diff --git a/autogpt_platform/backend/schema.prisma b/autogpt_platform/backend/schema.prismaindex e66c0f0515..54ec644087 100644--- a/autogpt_platform/backend/schema.prisma+++ b/autogpt_platform/backend/schema.prisma@@ -466,6 +466,7 @@ model LibraryAgent {isFavorite Boolean @default(false)isCreatedByUser Boolean @default(false)+ isHidden Boolean @default(false)isArchived Boolean @default(false)isDeleted Boolean @default(false)diff --git a/autogpt_platform/backend/scripts/gen_prisma_types_stub.py b/autogpt_platform/backend/scripts/gen_prisma_types_stub.pyindex 3f6073b2ff..63e6afd246 100644--- a/autogpt_platform/backend/scripts/gen_prisma_types_stub.py+++ b/autogpt_platform/backend/scripts/gen_prisma_types_stub.py@@ -53,12 +53,15 @@ def _is_safe_type_alias(node: ast.Assign) -> bool:# Literal types are safeif base_name == "Literal":return True+ # Union types are safe (e.g. Serializable = Union[...])+ if base_name == "Union":+ return True# TypeVar is safeif base_name == "TypeVar":return Trueelif isinstance(node.value.value, ast.Attribute):# Handle typing_extensions.Literal etc.- if node.value.value.attr == "Literal":+ if node.value.value.attr in ("Literal", "Union"):return True# Check if it's a simple Name reference (like SortMode = _types.SortMode)diff --git a/autogpt_platform/backend/snapshots/lib_agts_search b/autogpt_platform/backend/snapshots/lib_agts_searchindex b9c5aa211a..8100ad64e4 100644--- a/autogpt_platform/backend/snapshots/lib_agts_search+++ b/autogpt_platform/backend/snapshots/lib_agts_search@@ -39,6 +39,7 @@"is_favorite": false,"folder_id": null,"folder_name": null,+ "is_hidden": false,"recommended_schedule_cron": null,"is_scheduled": false,"next_scheduled_run": null,@@ -88,6 +89,7 @@"is_favorite": false,"folder_id": null,"folder_name": null,+ "is_hidden": false,"recommended_schedule_cron": null,"is_scheduled": false,"next_scheduled_run": null,diff --git a/autogpt_platform/backend/test/agent_generator/test_library_agents.py b/autogpt_platform/backend/test/agent_generator/test_library_agents.pyindex 508146af6a..9b389ae5f0 100644--- a/autogpt_platform/backend/test/agent_generator/test_library_agents.py+++ b/autogpt_platform/backend/test/agent_generator/test_library_agents.py@@ -50,6 +50,7 @@ class TestGetLibraryAgentsForGeneration:page=1,page_size=15,include_executions=True,+ is_hidden=False,)# Verify result format@@ -124,6 +125,7 @@ class TestGetLibraryAgentsForGeneration:page=1,page_size=5,include_executions=True,+ is_hidden=False,)diff --git a/autogpt_platform/frontend/package.json b/autogpt_platform/frontend/package.jsonindex 68815bcf79..ca398fcefa 100644--- a/autogpt_platform/frontend/package.json+++ b/autogpt_platform/frontend/package.json@@ -145,6 +145,7 @@"@tanstack/react-query-devtools": "5.90.2","@testing-library/dom": "10.4.1","@testing-library/react": "16.3.2",+ "@testing-library/user-event": "14.6.1","@types/canvas-confetti": "1.9.0","@types/lodash": "4.17.20","@types/negotiator": "0.6.4",diff --git a/autogpt_platform/frontend/pnpm-lock.yaml b/autogpt_platform/frontend/pnpm-lock.yamlindex e0d4c590fb..23856ce107 100644--- a/autogpt_platform/frontend/pnpm-lock.yaml+++ b/autogpt_platform/frontend/pnpm-lock.yaml@@ -346,6 +346,9 @@ importers:'@testing-library/react':specifier: 16.3.2version: 16.3.2(@testing-library/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@testing-library/user-event':+ specifier: 14.6.1+ version: 14.6.1(@testing-library/[email protected])'@types/canvas-confetti':specifier: 1.9.0version: 1.9.0diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/NewControlPanel/NewBlockMenu/MyAgentsContent/useMyAgentsContent.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/NewControlPanel/NewBlockMenu/MyAgentsContent/useMyAgentsContent.tsindex 5ce19afe96..63f827499d 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/NewControlPanel/NewBlockMenu/MyAgentsContent/useMyAgentsContent.ts+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/NewControlPanel/NewBlockMenu/MyAgentsContent/useMyAgentsContent.ts@@ -24,6 +24,7 @@ export const useMyAgentsContent = () => {{page: 1,page_size: 10,+ is_hidden: false,},{query: { getNextPageParam: getPaginationNextPageNumber },diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/__tests__/trigger-agents.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/__tests__/trigger-agents.test.tsxnew file mode 100644index 0000000000..aa54a506fd--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/__tests__/trigger-agents.test.tsx@@ -0,0 +1,515 @@+import {+ getDeleteV2DeleteLibraryAgentMockHandler,+ getDeleteV2DeleteLibraryAgentMockHandler422,+ getGetV2GetLibraryAgentMockHandler,+ getGetV2GetLibraryAgentResponseMock,+ getGetV2ListTriggerAgentsMockHandler,+} from "@/app/api/__generated__/endpoints/library/library.msw";+import { getGetV1ListGraphExecutionsMockHandler } from "@/app/api/__generated__/endpoints/graphs/graphs.msw";+import { getGetV1ListExecutionSchedulesForAGraphMockHandler } from "@/app/api/__generated__/endpoints/schedules/schedules.msw";+import { getGetV2ListPresetsMockHandler } from "@/app/api/__generated__/endpoints/presets/presets.msw";+import { TooltipProvider } from "@/components/atoms/Tooltip/BaseTooltip";+import { BackendAPIProvider } from "@/lib/autogpt-server-api/context";+import OnboardingProvider from "@/providers/onboarding/onboarding-provider";+import { server } from "@/mocks/mock-server";+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";+import { fireEvent, render, screen, waitFor } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { NuqsTestingAdapter } from "nuqs/adapters/testing";+import { ReactNode } from "react";+import { beforeEach, describe, expect, test, vi } from "vitest";+import { NewAgentLibraryView } from "../components/NewAgentLibraryView/NewAgentLibraryView";++const PARENT_ID = "parent-agent-id";+const PARENT_GRAPH_ID = "parent-graph-id";+const TRIGGER_ID = "trigger-agent-id";+const TRIGGER_GRAPH_ID = "trigger-graph-id";++vi.mock("next/navigation", async (importOriginal) => {+ const actual = await importOriginal<typeof import("next/navigation")>();+ return {+ ...actual,+ useParams: () => ({ id: PARENT_ID }),+ useRouter: () => ({+ push: vi.fn(),+ replace: vi.fn(),+ refresh: vi.fn(),+ }),+ usePathname: () => `/library/agents/${PARENT_ID}`,+ useSearchParams: () => new URLSearchParams(),+ };+});++vi.mock("@/lib/supabase/hooks/useSupabase", () => ({+ useSupabase: () => ({+ user: { id: "user-1", email: "[email protected]" },+ isLoggedIn: true,+ isUserLoading: false,+ supabase: {},+ }),+}));++const mockToast = vi.hoisted(() => vi.fn());+vi.mock("@/components/molecules/Toast/use-toast", () => ({+ useToast: () => ({ toast: mockToast, toasts: [], dismiss: vi.fn() }),+ toast: mockToast,+ useToastOnFail: () => vi.fn(),+}));++// Default to flag ON so the existing tests exercise the full UI; the+// flag-off branch is covered by a dedicated test that overrides this+// per-call.+const mockUseGetFlag = vi.hoisted(() => vi.fn(() => true));+vi.mock("@/services/feature-flags/use-get-flag", () => ({+ Flag: {+ GENERIC_TRIGGER_AGENTS: "generic-trigger-agents",+ },+ useGetFlag: mockUseGetFlag,+}));++// Per-test render wrapper so we can set the nuqs initial URL state+// (e.g. activeTab=triggers) — Radix tab clicks don't always round-trip+// through the NuqsTestingAdapter within a single sync frame.+function renderWithInitialParams(ui: ReactNode, searchParams = "") {+ const queryClient = new QueryClient({+ defaultOptions: { queries: { retry: false } },+ });+ return render(+ <QueryClientProvider client={queryClient}>+ <NuqsTestingAdapter searchParams={searchParams}>+ <BackendAPIProvider>+ <OnboardingProvider>+ <TooltipProvider>{ui}</TooltipProvider>+ </OnboardingProvider>+ </BackendAPIProvider>+ </NuqsTestingAdapter>+ </QueryClientProvider>,+ );+}++function baseHandlers(+ overrides?: Partial<ReturnType<typeof getGetV2GetLibraryAgentResponseMock>>,+) {+ const parentAgent = getGetV2GetLibraryAgentResponseMock({+ id: PARENT_ID,+ graph_id: PARENT_GRAPH_ID,+ name: "Parent Agent",+ description: "The parent",+ is_hidden: false,+ ...overrides,+ });+ return [+ getGetV2GetLibraryAgentMockHandler(parentAgent),+ getGetV1ListGraphExecutionsMockHandler({+ executions: [],+ pagination: {+ total_items: 0,+ total_pages: 0,+ current_page: 1,+ page_size: 20,+ },+ }),+ ];+}++const emptyPresetsHandler = getGetV2ListPresetsMockHandler({+ presets: [],+ pagination: {+ total_items: 0,+ total_pages: 0,+ current_page: 1,+ page_size: 100,+ },+});+const emptySchedulesHandler =+ getGetV1ListExecutionSchedulesForAGraphMockHandler([]);++describe("Library agent view — trigger agents", () => {+ beforeEach(() => {+ server.resetHandlers();+ mockToast.mockClear();+ mockUseGetFlag.mockReturnValue(true);+ });++ test("hides Triggers tab when there are no trigger agents and no webhook triggers", async () => {+ server.use(+ ...baseHandlers(),+ emptyPresetsHandler,+ emptySchedulesHandler,+ getGetV2ListTriggerAgentsMockHandler([]),+ );++ renderWithInitialParams(<NewAgentLibraryView />);++ await screen.findByText("Parent Agent");+ expect(screen.queryByRole("tab", { name: /triggers/i })).toBeNull();+ });++ test("shows trigger agent in 'Trigger Agents' subsection when one exists", async () => {+ const triggerAgent = getGetV2GetLibraryAgentResponseMock({+ id: TRIGGER_ID,+ graph_id: TRIGGER_GRAPH_ID,+ name: "Email Watcher",+ description: "Watches my inbox",+ is_hidden: true,+ });++ server.use(+ ...baseHandlers(),+ emptyPresetsHandler,+ emptySchedulesHandler,+ getGetV2ListTriggerAgentsMockHandler([triggerAgent]),+ );++ renderWithInitialParams(<NewAgentLibraryView />, "activeTab=triggers");++ await screen.findByText("Parent Agent");+ await screen.findByText("Trigger Agents");+ const rows = await screen.findAllByText("Email Watcher");+ expect(rows.length).toBeGreaterThan(0);+ expect(screen.queryByText("Webhook Triggers")).toBeNull();+ });++ test("shows both 'Webhook Triggers' and 'Trigger Agents' subsections when both exist", async () => {+ const triggerAgent = getGetV2GetLibraryAgentResponseMock({+ id: TRIGGER_ID,+ graph_id: TRIGGER_GRAPH_ID,+ name: "RSS Watcher",+ is_hidden: true,+ });++ server.use(+ ...baseHandlers(),+ emptySchedulesHandler,+ getGetV2ListTriggerAgentsMockHandler([triggerAgent]),+ getGetV2ListPresetsMockHandler({+ presets: [+ {+ id: "preset-1",+ user_id: "user-1",+ graph_id: PARENT_GRAPH_ID,+ graph_version: 1,+ name: "Webhook Trigger",+ description: "",+ inputs: {},+ credentials: {},+ is_active: true,+ webhook_id: "webhook-1",+ webhook: null,+ created_at: new Date("2026-01-01T00:00:00.000Z"),+ updated_at: new Date("2026-01-01T00:00:00.000Z"),+ },+ ],+ pagination: {+ total_items: 1,+ total_pages: 1,+ current_page: 1,+ page_size: 100,+ },+ }),+ );++ renderWithInitialParams(<NewAgentLibraryView />, "activeTab=triggers");++ await screen.findByText("Parent Agent");+ await screen.findByText("Webhook Triggers");+ await screen.findByText("Trigger Agents");+ expect((await screen.findAllByText("RSS Watcher")).length).toBeGreaterThan(+ 0,+ );+ expect(+ (await screen.findAllByText("Webhook Trigger")).length,+ ).toBeGreaterThan(0);+ });++ test("selecting a trigger agent renders its detail view with schedule info", async () => {+ const triggerAgent = getGetV2GetLibraryAgentResponseMock({+ id: TRIGGER_ID,+ graph_id: TRIGGER_GRAPH_ID,+ name: "Daily Summary Trigger",+ description: "Runs every morning at 8am",+ is_hidden: true,+ });++ server.use(+ ...baseHandlers(),+ emptyPresetsHandler,+ getGetV2ListTriggerAgentsMockHandler([triggerAgent]),+ getGetV1ListExecutionSchedulesForAGraphMockHandler([+ {+ id: "sched-1",+ name: "Morning run",+ user_id: "user-1",+ graph_id: TRIGGER_GRAPH_ID,+ graph_version: 1,+ cron: "0 8 * * *",+ timezone: "UTC",+ next_run_time: "2026-05-01T08:00:00.000Z",+ input_data: {},+ input_credentials: {},+ },+ ]),+ );++ // Render with the trigger already selected via URL state — avoids+ // relying on clicks to transition tab + selection together.+ renderWithInitialParams(+ <NewAgentLibraryView />,+ `activeTab=triggers&activeItem=${TRIGGER_ID}`,+ );++ // Description shows in the detail card, not the sidebar row+ await screen.findByText("Runs every morning at 8am");+ // Schedule card header + labels+ await screen.findByText("Schedule");+ await screen.findByText("Recurrence");+ await screen.findByText("Next run");+ });++ test("clicking Remove on a trigger agent deletes it via the library-agent delete endpoint", async () => {+ const triggerAgent = getGetV2GetLibraryAgentResponseMock({+ id: TRIGGER_ID,+ graph_id: TRIGGER_GRAPH_ID,+ name: "Remove Me",+ is_hidden: true,+ });++ const deleteCalls: string[] = [];+ server.use(+ ...baseHandlers(),+ emptyPresetsHandler,+ emptySchedulesHandler,+ getGetV2ListTriggerAgentsMockHandler([triggerAgent]),+ getDeleteV2DeleteLibraryAgentMockHandler(+ ({ params }: { params: Record<string, string> }) => {+ deleteCalls.push(String(params.libraryAgentId));+ return new Response(null, { status: 204 });+ },+ ),+ );++ // Render with trigger selected so we can use the action button in+ // the side panel (stable role-based query, avoids dropdown complexity).+ renderWithInitialParams(+ <NewAgentLibraryView />,+ `activeTab=triggers&activeItem=${TRIGGER_ID}`,+ );++ // Wait until the trigger detail view is fully rendered+ await screen.findByText("Remove Me");++ // Side panel has "Remove trigger" icon button+ const removeButton = await screen.findByRole("button", {+ name: /remove trigger/i,+ });+ fireEvent.click(removeButton);++ // Confirm dialog — the destructive confirmation button+ const confirmButton = await screen.findByRole("button", {+ name: /^remove trigger$/i,+ });+ // There may be two "Remove trigger" buttons now (icon + confirm).+ // Click the one inside the dialog specifically.+ fireEvent.click(confirmButton);++ await waitFor(() => {+ expect(deleteCalls).toContain(TRIGGER_ID);+ });+ // Must delete the TRIGGER agent, never the parent+ expect(deleteCalls).not.toContain(PARENT_ID);+ });++ test("detail view shows 'No schedule configured' when trigger agent has no schedule", async () => {+ const triggerAgent = getGetV2GetLibraryAgentResponseMock({+ id: TRIGGER_ID,+ graph_id: TRIGGER_GRAPH_ID,+ name: "Idle Trigger",+ description: "No schedule yet",+ is_hidden: true,+ });++ server.use(+ ...baseHandlers(),+ emptyPresetsHandler,+ emptySchedulesHandler, // returns [] for any graph+ getGetV2ListTriggerAgentsMockHandler([triggerAgent]),+ );++ renderWithInitialParams(+ <NewAgentLibraryView />,+ `activeTab=triggers&activeItem=${TRIGGER_ID}`,+ );++ await screen.findByText("No schedule yet");+ // Fallback card renders the "No schedule configured" message+ await screen.findByText(/no schedule configured/i);+ // And NOT the recurrence/next-run labels+ expect(screen.queryByText("Recurrence")).toBeNull();+ expect(screen.queryByText("Next run")).toBeNull();+ });++ test("sidebar dropdown Remove deletes the trigger via the shared delete flow", async () => {+ const user = userEvent.setup();+ const triggerAgent = getGetV2GetLibraryAgentResponseMock({+ id: TRIGGER_ID,+ graph_id: TRIGGER_GRAPH_ID,+ name: "Dropdown Victim",+ is_hidden: true,+ });++ const deleteCalls: string[] = [];+ server.use(+ ...baseHandlers(),+ emptyPresetsHandler,+ emptySchedulesHandler,+ getGetV2ListTriggerAgentsMockHandler([triggerAgent]),+ getDeleteV2DeleteLibraryAgentMockHandler(+ ({ params }: { params: Record<string, string> }) => {+ deleteCalls.push(String(params.libraryAgentId));+ return new Response(null, { status: 204 });+ },+ ),+ );++ // Render on Triggers tab WITHOUT activeItem so the sidebar dropdown+ // is the path under test (not the side panel).+ renderWithInitialParams(<NewAgentLibraryView />, "activeTab=triggers");++ await screen.findByText("Dropdown Victim");++ // Open the trigger-agent row's dropdown. Other rows may also have+ // "More actions" buttons (webhook triggers) but we only have one+ // trigger-agent row, and the agent-trigger dropdown is the only+ // one rendered here (no webhook presets in this test).+ const moreButton = await screen.findByRole("button", {+ name: /more actions/i,+ });+ await user.click(moreButton);++ // Click "Remove trigger" menu item+ const removeMenuItem = await screen.findByRole("menuitem", {+ name: /remove trigger/i,+ });+ await user.click(removeMenuItem);++ // Confirm in the destructive dialog+ const confirmButton = await screen.findByRole("button", {+ name: /^remove trigger$/i,+ });+ await user.click(confirmButton);++ await waitFor(() => {+ expect(deleteCalls).toContain(TRIGGER_ID);+ });+ expect(deleteCalls).not.toContain(PARENT_ID);+ });++ test("delete error shows a destructive toast via the hook's onError path", async () => {+ const user = userEvent.setup();+ const triggerAgent = getGetV2GetLibraryAgentResponseMock({+ id: TRIGGER_ID,+ graph_id: TRIGGER_GRAPH_ID,+ name: "Error Case",+ is_hidden: true,+ });++ server.use(+ ...baseHandlers(),+ emptyPresetsHandler,+ emptySchedulesHandler,+ getGetV2ListTriggerAgentsMockHandler([triggerAgent]),+ // Backend rejects the delete with 422 — exercises the hook's+ // onError path and proves the mutation doesn't crash with an+ // unhandled rejection when the request fails.+ getDeleteV2DeleteLibraryAgentMockHandler422(),+ );++ renderWithInitialParams(+ <NewAgentLibraryView />,+ `activeTab=triggers&activeItem=${TRIGGER_ID}`,+ );++ await screen.findByText("Error Case");++ const removeButton = await screen.findByRole("button", {+ name: /remove trigger/i,+ });+ await user.click(removeButton);++ const confirmButton = await screen.findByRole("button", {+ name: /^remove trigger$/i,+ });+ await user.click(confirmButton);++ // The hook's onError called toast() with the failure title —+ // a success would produce a different title ("Trigger removed").+ await waitFor(() => {+ expect(mockToast).toHaveBeenCalledWith(+ expect.objectContaining({+ title: expect.stringMatching(/failed to remove trigger/i),+ variant: "destructive",+ }),+ );+ });+ });++ test("when generic-trigger-agents flag is off, hides 'Trigger Agents' subsection and skips the trigger-agents fetch", async () => {+ mockUseGetFlag.mockReturnValue(false);++ let triggerAgentsCallCount = 0;+ const triggerAgent = getGetV2GetLibraryAgentResponseMock({+ id: TRIGGER_ID,+ graph_id: TRIGGER_GRAPH_ID,+ name: "Hidden Watcher",+ is_hidden: true,+ });++ server.use(+ ...baseHandlers(),+ emptySchedulesHandler,+ // Ensure backend would still serve a trigger agent if asked; we+ // assert the request never fires when the flag is off.+ getGetV2ListTriggerAgentsMockHandler(() => {+ triggerAgentsCallCount += 1;+ return [triggerAgent];+ }),+ // Webhook trigger so the Triggers tab still has reason to exist.+ getGetV2ListPresetsMockHandler({+ presets: [+ {+ id: "preset-1",+ user_id: "user-1",+ graph_id: PARENT_GRAPH_ID,+ graph_version: 1,+ name: "Webhook Trigger",+ description: "",+ inputs: {},+ credentials: {},+ is_active: true,+ webhook_id: "webhook-1",+ webhook: null,+ created_at: new Date("2026-01-01T00:00:00.000Z"),+ updated_at: new Date("2026-01-01T00:00:00.000Z"),+ },+ ],+ pagination: {+ total_items: 1,+ total_pages: 1,+ current_page: 1,+ page_size: 100,+ },+ }),+ );++ renderWithInitialParams(<NewAgentLibraryView />, "activeTab=triggers");++ await screen.findByText("Parent Agent");+ await screen.findByText("Webhook Triggers");+ // The "Trigger Agents" subsection must not render and the row name+ // must be absent.+ expect(screen.queryByText("Trigger Agents")).toBeNull();+ expect(screen.queryByText("Hidden Watcher")).toBeNull();+ // And the GET .../triggers request never fires.+ expect(triggerAgentsCallCount).toBe(0);+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/NewAgentLibraryView.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/NewAgentLibraryView.tsxindex 643788111f..8647836b48 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/NewAgentLibraryView.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/NewAgentLibraryView.tsx@@ -21,6 +21,7 @@ import { LoadingSelectedContent } from "./components/selected-views/LoadingSelecimport { SelectedRunView } from "./components/selected-views/SelectedRunView/SelectedRunView";import { SelectedScheduleView } from "./components/selected-views/SelectedScheduleView/SelectedScheduleView";import { SelectedTemplateView } from "./components/selected-views/SelectedTemplateView/SelectedTemplateView";+import { SelectedTriggerAgentView } from "./components/selected-views/SelectedTriggerAgentView/SelectedTriggerAgentView";import { SelectedTriggerView } from "./components/selected-views/SelectedTriggerView/SelectedTriggerView";import { SelectedViewLayout } from "./components/selected-views/SelectedViewLayout";import { SidebarRunsList } from "./components/sidebar/SidebarRunsList/SidebarRunsList";@@ -38,6 +39,7 @@ export function NewAgentLibraryView() {error,hasAnyItems,activeItem,+ isActiveItemTriggerAgent,sidebarLoading,activeTab,setActiveTab,@@ -224,13 +226,22 @@ export function NewAgentLibraryView() {banner={renderMarketplaceUpdateBanner()}/>) : activeTab === "triggers" ? (- <SelectedTriggerView- agent={agent}- triggerId={activeItem}- onClearSelectedRun={handleClearSelectedRun}- onSwitchToRunsTab={() => setActiveTab("runs")}- banner={renderMarketplaceUpdateBanner()}- />+ isActiveItemTriggerAgent ? (+ <SelectedTriggerAgentView+ agent={agent}+ triggerAgentId={activeItem}+ onClearSelectedRun={handleClearSelectedRun}+ banner={renderMarketplaceUpdateBanner()}+ />+ ) : (+ <SelectedTriggerView+ agent={agent}+ triggerId={activeItem}+ onClearSelectedRun={handleClearSelectedRun}+ onSwitchToRunsTab={() => setActiveTab("runs")}+ banner={renderMarketplaceUpdateBanner()}+ />+ )) : (<SelectedRunViewagent={agent}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedTriggerAgentView/SelectedTriggerAgentActions.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedTriggerAgentView/SelectedTriggerAgentActions.tsxnew file mode 100644index 0000000000..0cc318b8ae--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedTriggerAgentView/SelectedTriggerAgentActions.tsx@@ -0,0 +1,75 @@+"use client";++import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";+import { Button } from "@/components/atoms/Button/Button";+import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";+import {+ ArrowSquareOutIcon,+ PencilSimpleIcon,+ TrashIcon,+} from "@phosphor-icons/react";+import Link from "next/link";+import { useRemoveTriggerAgent } from "../../../hooks/useRemoveTriggerAgent";++interface Props {+ parentAgent: LibraryAgent;+ triggerAgent: LibraryAgent;+ onDeleted?: () => void;+}++export function SelectedTriggerAgentActions({+ parentAgent,+ triggerAgent,+ onDeleted,+}: Props) {+ const { openDialog, isDeleting, dialog } = useRemoveTriggerAgent({+ parentAgent,+ triggerAgent,+ onDeleted,+ });++ return (+ <>+ <div className="my-4 flex flex-col items-center gap-3">+ <Link+ href={`/library/agents/${triggerAgent.id}`}+ aria-label="View in library"+ >+ <Button variant="icon" size="icon" aria-label="View in library">+ <ArrowSquareOutIcon+ weight="bold"+ size={18}+ className="text-zinc-700"+ />+ </Button>+ </Link>+ <Link+ href={`/build?flowID=${triggerAgent.graph_id}`}+ aria-label="Open in builder"+ >+ <Button variant="icon" size="icon" aria-label="Open in builder">+ <PencilSimpleIcon+ weight="bold"+ size={18}+ className="text-zinc-700"+ />+ </Button>+ </Link>+ <Button+ variant="icon"+ size="icon"+ aria-label="Remove trigger"+ onClick={openDialog}+ disabled={isDeleting}+ >+ {isDeleting ? (+ <LoadingSpinner size="small" />+ ) : (+ <TrashIcon weight="bold" size={18} />+ )}+ </Button>+ </div>+ {dialog}+ </>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedTriggerAgentView/SelectedTriggerAgentView.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedTriggerAgentView/SelectedTriggerAgentView.tsxnew file mode 100644index 0000000000..e23184c2e7--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedTriggerAgentView/SelectedTriggerAgentView.tsx@@ -0,0 +1,175 @@+"use client";++import { useGetV2ListTriggerAgents } from "@/app/api/__generated__/endpoints/library/library";+import { useGetV1ListExecutionSchedulesForAGraph } from "@/app/api/__generated__/endpoints/schedules/schedules";+import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";+import { okData } from "@/app/api/helpers";+import { Text } from "@/components/atoms/Text/Text";+import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";+import { humanizeCronExpression } from "@/lib/cron-expression-utils";+import { useUserTimezone } from "@/lib/hooks/useUserTimezone";+import { formatInTimezone, getTimezoneDisplayName } from "@/lib/timezone-utils";+import { LoadingSelectedContent } from "../LoadingSelectedContent";+import { RunDetailCard } from "../RunDetailCard/RunDetailCard";+import { SelectedViewLayout } from "../SelectedViewLayout";+import { SelectedTriggerAgentActions } from "./SelectedTriggerAgentActions";++interface Props {+ agent: LibraryAgent;+ triggerAgentId: string;+ onClearSelectedRun?: () => void;+ banner?: React.ReactNode;+}++export function SelectedTriggerAgentView({+ agent,+ triggerAgentId,+ onClearSelectedRun,+ banner,+}: Props) {+ const { data, isLoading, error } = useGetV2ListTriggerAgents(agent.id, {+ query: { select: okData },+ });++ const triggerAgent = data?.find((t) => t.id === triggerAgentId);++ const {+ data: schedules,+ isLoading: isSchedulesLoading,+ error: schedulesError,+ } = useGetV1ListExecutionSchedulesForAGraph(triggerAgent?.graph_id || "", {+ query: {+ enabled: !!triggerAgent?.graph_id,+ select: okData,+ },+ });++ const rawUserTimezone = useUserTimezone();+ const displayTimezone =+ rawUserTimezone && rawUserTimezone !== "not-set"+ ? rawUserTimezone+ : Intl.DateTimeFormat().resolvedOptions().timeZone;+ const schedule = schedules?.[0];++ if (error || schedulesError) {+ const queryError = error ?? schedulesError;+ const message =+ queryError instanceof Error+ ? queryError.message+ : queryError != null+ ? String(queryError)+ : "Failed to load trigger data";+ return <ErrorCard responseError={{ message }} context="trigger agent" />;+ }++ if (isLoading || !data) {+ return <LoadingSelectedContent agent={agent} />;+ }++ if (!triggerAgent) {+ return (+ <SelectedViewLayout agent={agent} banner={banner}>+ <RunDetailCard title="Trigger not found">+ <Text variant="body" className="!text-zinc-500">+ This trigger agent no longer exists.+ </Text>+ </RunDetailCard>+ </SelectedViewLayout>+ );+ }++ return (+ <div className="flex h-full w-full gap-4">+ <div className="flex min-h-0 min-w-0 flex-1 flex-col">+ <SelectedViewLayout agent={agent} banner={banner}>+ <div className="flex flex-col gap-4">+ <RunDetailCard title={triggerAgent.name}>+ <div className="flex flex-col gap-3">+ {triggerAgent.description ? (+ <Text variant="body">{triggerAgent.description}</Text>+ ) : (+ <Text variant="body" className="!text-zinc-500">+ No description.+ </Text>+ )}+ <Text variant="small" className="!text-zinc-500">+ Trigger agents run on a schedule and execute this agent when+ their conditions are met. Edit them in the builder to change+ what they do.+ </Text>+ </div>+ </RunDetailCard>++ {schedule && (+ <RunDetailCard title="Schedule">+ <div className="flex flex-col gap-6">+ {schedule.graph_version !== triggerAgent.graph_version && (+ <Text+ variant="small"+ className="rounded-md bg-amber-50 px-3 py-2 !text-amber-800"+ >+ This schedule is running version {schedule.graph_version}{" "}+ of the trigger agent, but the latest version is{" "}+ {triggerAgent.graph_version}. Ask AutoPilot to recreate+ the schedule to pick up your latest edits.+ </Text>+ )}+ <div className="flex flex-col gap-1.5">+ <Text variant="large-medium">Recurrence</Text>+ <Text variant="body" className="flex items-center gap-3">+ {humanizeCronExpression(schedule.cron)}{" "}+ <span className="text-zinc-500">·</span>{" "}+ <span className="text-zinc-500">+ {getTimezoneDisplayName(+ displayTimezone || schedule.timezone || "UTC",+ )}+ </span>+ </Text>+ </div>+ <div className="flex flex-col gap-1.5">+ <Text variant="large-medium">Next run</Text>+ <Text variant="body" className="flex items-center gap-3">+ {formatInTimezone(+ schedule.next_run_time,+ displayTimezone || "UTC",+ {+ year: "numeric",+ month: "long",+ day: "numeric",+ hour: "2-digit",+ minute: "2-digit",+ hour12: false,+ },+ )}{" "}+ <span className="text-zinc-500">·</span>{" "}+ <span className="text-zinc-500">+ {getTimezoneDisplayName(+ displayTimezone || schedule.timezone || "UTC",+ )}+ </span>+ </Text>+ </div>+ </div>+ </RunDetailCard>+ )}++ {!schedule && !isSchedulesLoading && (+ <RunDetailCard title="Schedule">+ <Text variant="body" className="!text-zinc-500">+ No schedule configured for this trigger agent.+ </Text>+ </RunDetailCard>+ )}+ </div>+ </SelectedViewLayout>+ </div>+ <div className="-mt-2 max-w-[3.75rem] flex-shrink-0">+ <SelectedTriggerAgentActions+ parentAgent={agent}+ triggerAgent={triggerAgent}+ onDeleted={onClearSelectedRun}+ />+ </div>+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/SidebarRunsList.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/SidebarRunsList.tsxindex 8a1abe2c87..f5c55e7897 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/SidebarRunsList.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/SidebarRunsList.tsx@@ -17,6 +17,7 @@ import { AGENT_LIBRARY_SECTION_PADDING_X } from "../../../helpers";import { ScheduleListItem } from "./components/ScheduleListItem";import { TaskListItem } from "./components/TaskListItem";import { TemplateListItem } from "./components/TemplateListItem";+import { TriggerAgentListItem } from "./components/TriggerAgentListItem";import { TriggerListItem } from "./components/TriggerListItem";import { useSidebarRunsList } from "./useSidebarRunsList";@@ -53,6 +54,7 @@ export function SidebarRunsList({schedules,templates,triggers,+ triggerAgents,runsCount,schedulesCount,templatesCount,@@ -65,6 +67,7 @@ export function SidebarRunsList({tabValue,} = useSidebarRunsList({graphId: agent.graph_id,+ libraryAgentID: agent.id,onSelectRun,onCountsChange,});@@ -207,23 +210,59 @@ export function SidebarRunsList({AGENT_LIBRARY_SECTION_PADDING_X,)}>- <div className="flex h-full flex-nowrap items-center justify-start gap-4 overflow-x-scroll px-1 pb-4 pt-1 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-zinc-300 lg:flex-col lg:gap-3 lg:overflow-y-auto lg:overflow-x-hidden">- {triggers.length > 0 ? (- triggers.map((trigger) => (- <div className="w-[15rem] lg:w-full" key={trigger.id}>- <TriggerListItem- trigger={trigger}- agent={agent}- selected={selectedRunId === trigger.id}- onClick={() => onSelectRun(trigger.id, "triggers")}- />+ <div className="flex h-full flex-col gap-4 overflow-x-scroll px-1 pb-4 pt-1 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-zinc-300 lg:gap-3 lg:overflow-y-auto lg:overflow-x-hidden">+ {triggers.length > 0 && (+ <div className="flex flex-col gap-2">+ <Text variant="body-medium" className="px-1 !text-zinc-500">+ Webhook Triggers+ </Text>+ <div className="flex flex-nowrap items-center justify-start gap-4 lg:flex-col lg:gap-3">+ {triggers.map((trigger) => (+ <div className="w-[15rem] lg:w-full" key={trigger.id}>+ <TriggerListItem+ trigger={trigger}+ agent={agent}+ selected={selectedRunId === trigger.id}+ onClick={() => onSelectRun(trigger.id, "triggers")}+ />+ </div>+ ))}+ </div>+ </div>+ )}+ {triggerAgents.length > 0 && (+ <div className="flex flex-col gap-2">+ <Text variant="body-medium" className="px-1 !text-zinc-500">+ Trigger Agents+ </Text>+ <div className="flex flex-nowrap items-center justify-start gap-4 lg:flex-col lg:gap-3">+ {triggerAgents.map((triggerAgent) => (+ <div+ className="w-[15rem] lg:w-full"+ key={triggerAgent.id}+ >+ <TriggerAgentListItem+ triggerAgent={triggerAgent}+ parentAgent={agent}+ selected={selectedRunId === triggerAgent.id}+ onClick={() =>+ onSelectRun(triggerAgent.id, "triggers")+ }+ />+ </div>+ ))}</div>- ))- ) : (- <div className="flex min-h-[50vh] flex-col items-center justify-center">+ </div>+ )}+ {triggers.length === 0 && triggerAgents.length === 0 && (+ <div className="flex min-h-[50vh] flex-col items-center justify-center gap-2 px-6 text-center"><Text variant="large" className="text-zinc-700">No triggers set up</Text>+ <Text variant="body" className="!text-zinc-500">+ Ask AutoPilot to set up a trigger for this agent (e.g.+ “run this when a new email arrives”).+ </Text></div>)}</div>diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/TriggerAgentActionsDropdown.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/TriggerAgentActionsDropdown.tsxnew file mode 100644index 0000000000..47878aba55--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/TriggerAgentActionsDropdown.tsx@@ -0,0 +1,76 @@+"use client";++import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";+import { Button } from "@/components/atoms/Button/Button";+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuTrigger,+} from "@/components/molecules/DropdownMenu/DropdownMenu";+import { DotsThreeVerticalIcon } from "@phosphor-icons/react";+import Link from "next/link";+import { useRemoveTriggerAgent } from "../../../../hooks/useRemoveTriggerAgent";++interface Props {+ parentAgent: LibraryAgent;+ triggerAgent: LibraryAgent;+ onDeleted?: () => void;+}++export function TriggerAgentActionsDropdown({+ parentAgent,+ triggerAgent,+ onDeleted,+}: Props) {+ const { openDialog, dialog } = useRemoveTriggerAgent({+ parentAgent,+ triggerAgent,+ onDeleted,+ });++ return (+ <>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button+ variant="icon"+ size="icon"+ onClick={(e) => e.stopPropagation()}+ aria-label="More actions"+ className="ml-auto min-w-fit shrink-0"+ >+ <DotsThreeVerticalIcon size={18} />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuItem asChild>+ <Link+ href={`/library/agents/${triggerAgent.id}`}+ onClick={(e) => e.stopPropagation()}+ >+ View in library+ </Link>+ </DropdownMenuItem>+ <DropdownMenuItem asChild>+ <Link+ href={`/build?flowID=${triggerAgent.graph_id}`}+ onClick={(e) => e.stopPropagation()}+ >+ Open in builder+ </Link>+ </DropdownMenuItem>+ <DropdownMenuItem+ onClick={(e) => {+ e.stopPropagation();+ openDialog();+ }}+ >+ Remove trigger+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ {dialog}+ </>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/TriggerAgentListItem.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/TriggerAgentListItem.tsxnew file mode 100644index 0000000000..bcbf4539bf--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/TriggerAgentListItem.tsx@@ -0,0 +1,47 @@+"use client";++import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";+import { RobotIcon } from "@phosphor-icons/react";+import { formatDistanceToNow } from "date-fns";+import { IconWrapper } from "./IconWrapper";+import { SidebarItemCard } from "./SidebarItemCard";+import { TriggerAgentActionsDropdown } from "./TriggerAgentActionsDropdown";++interface Props {+ triggerAgent: LibraryAgent;+ parentAgent: LibraryAgent;+ selected?: boolean;+ onClick?: () => void;+ onDeleted?: () => void;+}++export function TriggerAgentListItem({+ triggerAgent,+ parentAgent,+ selected,+ onClick,+ onDeleted,+}: Props) {+ return (+ <SidebarItemCard+ icon={+ <IconWrapper className="border-blue-50 bg-blue-50">+ <RobotIcon size={16} className="text-zinc-700" weight="bold" />+ </IconWrapper>+ }+ title={triggerAgent.name}+ description={`Updated ${formatDistanceToNow(triggerAgent.updated_at, {+ addSuffix: true,+ })}`}+ onClick={onClick}+ selected={selected}+ actions={+ <TriggerAgentActionsDropdown+ parentAgent={parentAgent}+ triggerAgent={triggerAgent}+ onDeleted={onDeleted}+ />+ }+ />+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/useSidebarRunsList.ts b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/useSidebarRunsList.tsindex 971b90c2e3..3b74e9ff6a 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/useSidebarRunsList.ts+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/useSidebarRunsList.ts@@ -9,9 +9,11 @@ import {unpaginate,} from "@/app/api/helpers";import { useGetV1ListGraphExecutionsInfinite } from "@/app/api/__generated__/endpoints/graphs/graphs";+import { useGetV2ListTriggerAgents } from "@/app/api/__generated__/endpoints/library/library";import { useGetV2ListPresets } from "@/app/api/__generated__/endpoints/presets/presets";import { useGetV1ListExecutionSchedulesForAGraph } from "@/app/api/__generated__/endpoints/schedules/schedules";import { useExecutionEvents } from "@/hooks/useExecutionEvents";+import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";import { useQueryClient } from "@tanstack/react-query";import { parseAsString, useQueryStates } from "nuqs";@@ -31,6 +33,7 @@ function parseTab(type Args = {graphId: string;+ libraryAgentID: string;onSelectRun: (runId: string,tab?: "runs" | "scheduled" | "templates" | "triggers",@@ -46,6 +49,7 @@ type Args = {export function useSidebarRunsList({graphId,+ libraryAgentID,onSelectRun,onCountsChange,}: Args) {@@ -86,6 +90,14 @@ export function useSidebarRunsList({},);+ const triggerAgentsEnabled = useGetFlag(Flag.GENERIC_TRIGGER_AGENTS);+ const triggerAgentsQuery = useGetV2ListTriggerAgents(libraryAgentID, {+ query: {+ enabled: triggerAgentsEnabled && !!libraryAgentID,+ select: okData,+ },+ });+const runs = useMemo(() => (runsQuery.data ? unpaginate(runsQuery.data, "executions") : []),[runsQuery.data],@@ -101,17 +113,26 @@ export function useSidebarRunsList({() => allPresets.filter((preset) => !preset.webhook_id),[allPresets],);+ const triggerAgents = triggerAgentsEnabled+ ? triggerAgentsQuery.data || []+ : [];const runsCount = getPaginatedTotalCount(runsQuery.data, runs.length);const schedulesCount = schedules.length;const templatesCount = templates.length;- const triggersCount = triggers.length;+ // Combined count: webhook triggers + trigger agents (both shown+ // under the "Triggers" tab as separate sections).+ const triggersCount = triggers.length + triggerAgents.length;const loading =!runsQuery.isSuccess ||!schedulesQuery.isSuccess ||- !presetsQuery.isSuccess;+ !presetsQuery.isSuccess ||+ (triggerAgentsEnabled && !triggerAgentsQuery.isSuccess);const stale =- runsQuery.isStale || schedulesQuery.isStale || presetsQuery.isStale;+ runsQuery.isStale ||+ schedulesQuery.isStale ||+ presetsQuery.isStale ||+ (triggerAgentsEnabled && triggerAgentsQuery.isStale);// Update query cache when execution events arrive via websocketuseExecutionEvents({@@ -167,17 +188,25 @@ export function useSidebarRunsList({}, [templates, activeItem, tabValue, onSelectRun]);useEffect(() => {- if (triggers.length > 0 && tabValue === "triggers" && !activeItem) {+ if (tabValue !== "triggers" || activeItem) return;+ if (triggers.length > 0) {onSelectRun(triggers[0].id, "triggers");+ } else if (triggerAgents.length > 0) {+ onSelectRun(triggerAgents[0].id, "triggers");}- }, [triggers, activeItem, tabValue, onSelectRun]);+ }, [triggers, triggerAgents, activeItem, tabValue, onSelectRun]);return {runs,schedules,templates,triggers,- error: schedulesQuery.error || runsQuery.error || presetsQuery.error,+ triggerAgents,+ error:+ schedulesQuery.error ||+ runsQuery.error ||+ presetsQuery.error ||+ (triggerAgentsEnabled ? triggerAgentsQuery.error : null),loading,runsQuery,tabValue,diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/hooks/useRemoveTriggerAgent.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/hooks/useRemoveTriggerAgent.tsxnew file mode 100644index 0000000000..e5a541298d--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/hooks/useRemoveTriggerAgent.tsx@@ -0,0 +1,106 @@+"use client";++import {+ getGetV2ListTriggerAgentsQueryKey,+ useDeleteV2DeleteLibraryAgent,+} from "@/app/api/__generated__/endpoints/library/library";+import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";+import { Button } from "@/components/atoms/Button/Button";+import { Text } from "@/components/atoms/Text/Text";+import { Dialog } from "@/components/molecules/Dialog/Dialog";+import { useToast } from "@/components/molecules/Toast/use-toast";+import { useQueryClient } from "@tanstack/react-query";+import { ReactNode, useState } from "react";++interface Args {+ parentAgent: LibraryAgent;+ triggerAgent: LibraryAgent;+ onDeleted?: () => void;+}++/**+ * Shared delete flow for a trigger agent — confirmation dialog,+ * mutation, toast notifications, and parent-list invalidation.+ *+ * Used by both `SelectedTriggerAgentActions` (side panel icon button)+ * and `TriggerAgentActionsDropdown` (sidebar three-dots menu), which+ * render different triggers but need identical delete behavior.+ */+export function useRemoveTriggerAgent({+ parentAgent,+ triggerAgent,+ onDeleted,+}: Args): {+ openDialog: () => void;+ isDeleting: boolean;+ dialog: ReactNode;+} {+ const { toast } = useToast();+ const queryClient = useQueryClient();+ const [showDialog, setShowDialog] = useState(false);++ const { mutate: deleteLibraryAgent, isPending } =+ useDeleteV2DeleteLibraryAgent({+ mutation: {+ onSuccess: async () => {+ toast({ title: "Trigger removed" });+ queryClient.invalidateQueries({+ queryKey: getGetV2ListTriggerAgentsQueryKey(parentAgent.id),+ });+ setShowDialog(false);+ onDeleted?.();+ },+ onError: (error) => {+ toast({+ title: "Failed to remove trigger",+ description:+ error instanceof Error+ ? error.message+ : "An unexpected error occurred.",+ variant: "destructive",+ });+ },+ },+ });++ function handleDelete() {+ deleteLibraryAgent({ libraryAgentId: triggerAgent.id });+ }++ const dialog = (+ <Dialog+ controlled={{ isOpen: showDialog, set: setShowDialog }}+ styling={{ maxWidth: "32rem" }}+ title="Remove trigger"+ >+ <Dialog.Content>+ <Text variant="large">+ Are you sure you want to remove this trigger? The trigger agent and+ its schedule will be deleted. This action cannot be undone.+ </Text>+ <Dialog.Footer>+ <Button+ variant="secondary"+ disabled={isPending}+ onClick={() => setShowDialog(false)}+ >+ Cancel+ </Button>+ <Button+ variant="destructive"+ onClick={handleDelete}+ loading={isPending}+ >+ Remove trigger+ </Button>+ </Dialog.Footer>+ </Dialog.Content>+ </Dialog>+ );++ return {+ openDialog: () => setShowDialog(true),+ isDeleting: isPending,+ dialog,+ };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/useNewAgentLibraryView.ts b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/useNewAgentLibraryView.tsindex 83c378ac8e..fd4995df68 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/useNewAgentLibraryView.ts+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/useNewAgentLibraryView.ts@@ -1,10 +1,14 @@-import { useGetV2GetLibraryAgent } from "@/app/api/__generated__/endpoints/library/library";+import {+ useGetV2GetLibraryAgent,+ useGetV2ListTriggerAgents,+} from "@/app/api/__generated__/endpoints/library/library";import { useGetV2GetASpecificPreset } from "@/app/api/__generated__/endpoints/presets/presets";import { useGetV1ListExecutionSchedulesForAGraph } from "@/app/api/__generated__/endpoints/schedules/schedules";import { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import { GraphExecutionMeta } from "@/app/api/__generated__/models/graphExecutionMeta";import { LibraryAgentPreset } from "@/app/api/__generated__/models/libraryAgentPreset";import { okData } from "@/app/api/helpers";+import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";import { useParams } from "next/navigation";import { parseAsString, useQueryStates } from "nuqs";import { useCallback, useEffect, useMemo, useState } from "react";@@ -27,12 +31,22 @@ export function useNewAgentLibraryView() {const { id } = useParams();const agentId = id as string;+ // TODO(#12740 / autogpt-pr-reviewer): when agent.is_hidden is true,+ // surface a banner that this is a trigger agent and link to its parent.+ // Needs a back-derivation path (parent has no FK to its triggers) —+ // either a new endpoint or scanning AgentExecutorBlock constantInput+ // across the user's library.const {data: agent,isSuccess,error,} = useGetV2GetLibraryAgent(agentId, { query: { select: okData } });+ const triggerAgentsEnabled = useGetFlag(Flag.GENERIC_TRIGGER_AGENTS);+ const { data: triggerAgents } = useGetV2ListTriggerAgents(agentId, {+ query: { enabled: triggerAgentsEnabled && !!agentId, select: okData },+ });+const [{ activeItem, activeTab: activeTabRaw }, setQueryStates] =useQueryStates({activeItem: parseAsString,@@ -223,6 +237,12 @@ export function useNewAgentLibraryView() {onItemCreated({ item: newSchedule, type: "scheduled" });}+ const isActiveItemTriggerAgent =+ triggerAgentsEnabled &&+ activeTab === "triggers" &&+ !!activeItem &&+ !!triggerAgents?.some((t) => t.id === activeItem);+return {agentId: id,agent,@@ -233,6 +253,7 @@ export function useNewAgentLibraryView() {hasAnyItems,showSidebarLayout,activeItem,+ isActiveItemTriggerAgent,sidebarLoading,activeTab,setActiveTab: handleSetActiveTab,diff --git a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentList/useLibraryAgentList.ts b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentList/useLibraryAgentList.tsindex d4c79158a7..d228c35a20 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentList/useLibraryAgentList.ts+++ b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentList/useLibraryAgentList.ts@@ -75,6 +75,7 @@ export function useLibraryAgentList({sort_by: librarySort,folder_id: selectedFolderId ?? undefined,include_root_only: selectedFolderId === null ? true : undefined,+ is_hidden: false,},{query: {diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AddToLibraryButton/AddToLibraryButton.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AddToLibraryButton/AddToLibraryButton.tsxindex c8476d6fb9..e0605f8e0d 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AddToLibraryButton/AddToLibraryButton.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AddToLibraryButton/AddToLibraryButton.tsx@@ -83,13 +83,16 @@ export function AddToLibraryButton({const [justAdded, setJustAdded] = useState(false);// Only fetch library list if isInLibrary wasn't provided by parent- const { data: libraryAgents } = useGetV2ListLibraryAgents(undefined, {- query: {- enabled: isLoggedIn && isInLibrary === undefined,- select: (res) =>- res.status === 200 ? (res.data as LibraryAgentResponse) : undefined,+ const { data: libraryAgents } = useGetV2ListLibraryAgents(+ { is_hidden: false },+ {+ query: {+ enabled: isLoggedIn && isInLibrary === undefined,+ select: (res) =>+ res.status === 200 ? (res.data as LibraryAgentResponse) : undefined,+ },},- });+ );const { mutateAsync: addToLibrary, isPending } =usePostV2AddMarketplaceAgent();diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.jsonindex 0935cd744e..7915854522 100644--- a/autogpt_platform/frontend/src/app/api/openapi.json+++ b/autogpt_platform/frontend/src/app/api/openapi.json@@ -2109,6 +2109,8 @@"$ref": "#/components/schemas/MCPToolsDiscoveredResponse"},{ "$ref": "#/components/schemas/MCPToolOutputResponse" },+ { "$ref": "#/components/schemas/ScheduleListResponse" },+ { "$ref": "#/components/schemas/ScheduleDeletedResponse" },{ "$ref": "#/components/schemas/MemoryStoreResponse" },{ "$ref": "#/components/schemas/MemorySearchResponse" },{@@ -5473,6 +5475,17 @@"title": "Include Root Only"},"description": "Only return agents without a folder (root-level agents)"+ },+ {+ "name": "is_hidden",+ "in": "query",+ "required": false,+ "schema": {+ "anyOf": [{ "type": "boolean" }, { "type": "null" }],+ "description": "Filter by hidden status. True = only hidden, False = only non-hidden, omit = all agents.",+ "title": "Is Hidden"+ },+ "description": "Filter by hidden status. True = only hidden, False = only non-hidden, omit = all agents."}],"responses": {@@ -5840,6 +5853,48 @@}}},+ "/api/library/agents/{library_agent_id}/triggers": {+ "get": {+ "tags": ["v2", "library", "private"],+ "summary": "List Trigger Agents",+ "description": "List trigger agents linked to the given parent agent.",+ "operationId": "getV2List trigger agents",+ "security": [{ "HTTPBearerJWT": [] }],+ "parameters": [+ {+ "name": "library_agent_id",+ "in": "path",+ "required": true,+ "schema": { "type": "string", "title": "Library Agent Id" }+ }+ ],+ "responses": {+ "200": {+ "description": "Successful Response",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": { "$ref": "#/components/schemas/LibraryAgent" },+ "title": "Response Getv2List Trigger Agents"+ }+ }+ }+ },+ "401": {+ "$ref": "#/components/responses/HTTP401NotAuthenticatedError"+ },+ "422": {+ "description": "Validation Error",+ "content": {+ "application/json": {+ "schema": { "$ref": "#/components/schemas/HTTPValidationError" }+ }+ }+ }+ }+ }+ },"/api/library/folders": {"get": {"tags": ["v2", "library", "folders", "private"],@@ -12832,6 +12887,11 @@"anyOf": [{ "type": "string" }, { "type": "null" }],"title": "Folder Name"},+ "is_hidden": {+ "type": "boolean",+ "title": "Is Hidden",+ "default": false+ },"recommended_schedule_cron": {"anyOf": [{ "type": "string" }, { "type": "null" }],"title": "Recommended Schedule Cron"@@ -13103,6 +13163,11 @@"title": "Is Archived","description": "Archive the agent"},+ "is_hidden": {+ "anyOf": [{ "type": "boolean" }, { "type": "null" }],+ "title": "Is Hidden",+ "description": "Whether to hide the agent from the library listing"+ },"settings": {"anyOf": [{ "$ref": "#/components/schemas/GraphSettings" },@@ -15211,6 +15276,9 @@"block_details","block_output","review_required",+ "schedule_list",+ "schedule_deleted",+ "agent_trigger_list","mcp_guide","mcp_tools_discovered","mcp_tool_output",@@ -15470,6 +15538,24 @@"required": ["name", "cron", "inputs"],"title": "ScheduleCreationRequest"},+ "ScheduleDeletedResponse": {+ "properties": {+ "type": {+ "$ref": "#/components/schemas/ResponseType",+ "default": "schedule_deleted"+ },+ "message": { "type": "string", "title": "Message" },+ "session_id": {+ "anyOf": [{ "type": "string" }, { "type": "null" }],+ "title": "Session Id"+ },+ "schedule_id": { "type": "string", "title": "Schedule Id" }+ },+ "type": "object",+ "required": ["message", "schedule_id"],+ "title": "ScheduleDeletedResponse",+ "description": "Response confirming a schedule was deleted."+ },"ScheduleDetail": {"properties": {"schedule_id": { "type": "string", "title": "Schedule Id" },@@ -15571,6 +15657,51 @@"title": "ScheduleHealthMetrics","description": "Summary of schedule health diagnostics"},+ "ScheduleListResponse": {+ "properties": {+ "type": {+ "$ref": "#/components/schemas/ResponseType",+ "default": "schedule_list"+ },+ "message": { "type": "string", "title": "Message" },+ "session_id": {+ "anyOf": [{ "type": "string" }, { "type": "null" }],+ "title": "Session Id"+ },+ "schedules": {+ "items": { "$ref": "#/components/schemas/ScheduleSummary" },+ "type": "array",+ "title": "Schedules"+ }+ },+ "type": "object",+ "required": ["message", "schedules"],+ "title": "ScheduleListResponse",+ "description": "Response containing a list of schedules."+ },+ "ScheduleSummary": {+ "properties": {+ "schedule_id": { "type": "string", "title": "Schedule Id" },+ "name": { "type": "string", "title": "Name" },+ "cron": { "type": "string", "title": "Cron" },+ "timezone": { "type": "string", "title": "Timezone" },+ "next_run_time": { "type": "string", "title": "Next Run Time" },+ "graph_id": { "type": "string", "title": "Graph Id" },+ "graph_version": { "type": "integer", "title": "Graph Version" }+ },+ "type": "object",+ "required": [+ "schedule_id",+ "name",+ "cron",+ "timezone",+ "next_run_time",+ "graph_id",+ "graph_version"+ ],+ "title": "ScheduleSummary",+ "description": "Summary of a single schedule."+ },"SchedulesListResponse": {"properties": {"schedules": {diff --git a/autogpt_platform/frontend/src/hooks/useLibraryAgents/useLibraryAgents.ts b/autogpt_platform/frontend/src/hooks/useLibraryAgents/useLibraryAgents.tsindex 8f0fc51405..f506ccc72b 100644--- a/autogpt_platform/frontend/src/hooks/useLibraryAgents/useLibraryAgents.ts+++ b/autogpt_platform/frontend/src/hooks/useLibraryAgents/useLibraryAgents.ts@@ -9,6 +9,7 @@ export function useLibraryAgents() {{page: 1,page_size: 100,+ is_hidden: false,},{query: {diff --git a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.tsindex 78c82acc5c..2d3f082a84 100644--- a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts+++ b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts@@ -12,6 +12,7 @@ export enum Flag {CHAT_MODE_OPTION = "chat-mode-option",BUILDER_CHAT_PANEL = "builder-chat-panel",AGENT_BRIEFING = "agent-briefing",+ GENERIC_TRIGGER_AGENTS = "generic-trigger-agents",}const isPwMockEnabled = process.env.NEXT_PUBLIC_PW_TEST === "true";@@ -24,6 +25,7 @@ const defaultFlags = {[Flag.CHAT_MODE_OPTION]: false,[Flag.BUILDER_CHAT_PANEL]: false,[Flag.AGENT_BRIEFING]: false,+ [Flag.GENERIC_TRIGGER_AGENTS]: false,};type FlagValues = typeof defaultFlags;