From 5cecaf0f5816d50fdf58da19effdc48acc0209d4 Mon Sep 17 00:00:00 2001 From: Otto Date: Sat, 31 Jan 2026 14:52:21 +0000 Subject: [PATCH] refactor: rename to get_store_listed_graphs Clearer name indicating these are store-listed public graphs that don't require permission checks. --- .../api/features/chat/tools/agent_generator/core.py | 4 ++-- autogpt_platform/backend/backend/data/graph.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/autogpt_platform/backend/backend/api/features/chat/tools/agent_generator/core.py b/autogpt_platform/backend/backend/api/features/chat/tools/agent_generator/core.py index 9f04848889..1cd4c819c8 100644 --- a/autogpt_platform/backend/backend/api/features/chat/tools/agent_generator/core.py +++ b/autogpt_platform/backend/backend/api/features/chat/tools/agent_generator/core.py @@ -14,7 +14,7 @@ from backend.data.graph import ( create_graph, get_graph, get_graph_all_versions, - get_graphs_by_ids, + get_store_listed_graphs, ) from backend.util.exceptions import DatabaseError, NotFoundError @@ -295,7 +295,7 @@ async def search_marketplace_agents_for_generation( return [] graph_ids = [agent.agent_graph_id for agent in agents_with_graphs] - graphs = await get_graphs_by_ids(*graph_ids) + graphs = await get_store_listed_graphs(*graph_ids) results: list[LibraryAgentSummary] = [] for agent in agents_with_graphs: diff --git a/autogpt_platform/backend/backend/data/graph.py b/autogpt_platform/backend/backend/data/graph.py index f83c6ab2e2..ee6cd2e4b0 100644 --- a/autogpt_platform/backend/backend/data/graph.py +++ b/autogpt_platform/backend/backend/data/graph.py @@ -1028,18 +1028,17 @@ async def get_graph( return GraphModel.from_db(graph, for_export) -async def get_graphs_by_ids(*graph_ids: str) -> dict[str, GraphModel]: - """Batch-fetch multiple public/marketplace graphs by their IDs. +async def get_store_listed_graphs(*graph_ids: str) -> dict[str, GraphModel]: + """Batch-fetch multiple store-listed graphs by their IDs. - This fetches graphs that are publicly available via approved store listings. - Used for marketplace agent schema lookups where we need multiple graphs - in a single query. + Only returns graphs that have approved store listings (publicly available). + Does not require permission checks since store-listed graphs are public. Args: *graph_ids: Variable number of graph IDs to fetch Returns: - Dict mapping graph_id to GraphModel for successfully fetched graphs + Dict mapping graph_id to GraphModel for graphs with approved store listings """ if not graph_ids: return {}