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.
fix(backend/executor): make graph execution permission check version-agnostic (#11283)
Zamil Majdy5506d59da109
diff --git a/autogpt_platform/backend/backend/data/graph.py b/autogpt_platform/backend/backend/data/graph.pyindex b1a6c9f44e..02af3f7703 100644--- a/autogpt_platform/backend/backend/data/graph.py+++ b/autogpt_platform/backend/backend/data/graph.py@@ -1122,7 +1122,11 @@ async def validate_graph_execution_permissions(Args:graph_id: The ID of the graph to checkuser_id: The ID of the user- graph_version: Optional specific version to check+ graph_version: Optional specific version to check. If None (recommended),+ performs version-agnostic check allowing execution of any+ version as long as the graph is in the user's library.+ This is important for sub-graphs that may reference older+ versions no longer in the library.Raises:GraphNotInLibraryError: If the graph is not in the user's library (deleted/archived)diff --git a/autogpt_platform/backend/backend/executor/utils.py b/autogpt_platform/backend/backend/executor/utils.pyindex ac3ec9110e..27e695a159 100644--- a/autogpt_platform/backend/backend/executor/utils.py+++ b/autogpt_platform/backend/backend/executor/utils.py@@ -517,10 +517,12 @@ async def validate_and_construct_node_execution_input(# Validate that the user has permission to execute this graph# This checks both library membership and execution permissions,# raising specific exceptions for appropriate error handling+ # Note: Version-agnostic check to allow execution of graphs that reference+ # older versions of sub-graphs that may no longer be in the libraryawait gdb.validate_graph_execution_permissions(graph_id=graph_id,user_id=user_id,- graph_version=graph.version,+ # graph_version omitted for version-agnostic permission check)nodes_input_masks = _merge_nodes_input_masks(