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.
Revert "Merge branch 'master' of https://github.com/Significant-Gravitas/AutoGPT into ntindle/secrt-1218-add-ability-to-reject-approved-agents-in-admin-dashboard"
Nicholas Tindle260dd526c96a
diff --git a/autogpt_platform/backend/backend/executor/manager.py b/autogpt_platform/backend/backend/executor/manager.pyindex cc142bacd1..c5c45c2345 100644--- a/autogpt_platform/backend/backend/executor/manager.py+++ b/autogpt_platform/backend/backend/executor/manager.py@@ -1208,9 +1208,6 @@ class ExecutionManager(AppProcess):)return- # Check if channel is closed and force reconnection if needed- if not self.cancel_client.is_ready:- self.cancel_client.disconnect()self.cancel_client.connect()cancel_channel = self.cancel_client.get_channel()cancel_channel.basic_consume(@@ -1240,9 +1237,6 @@ class ExecutionManager(AppProcess):)return- # Check if channel is closed and force reconnection if needed- if not self.run_client.is_ready:- self.run_client.disconnect()self.run_client.connect()run_channel = self.run_client.get_channel()run_channel.basic_qos(prefetch_count=self.pool_size)diff --git a/autogpt_platform/backend/backend/executor/scheduler.py b/autogpt_platform/backend/backend/executor/scheduler.pyindex 3d6ac59a3c..50b165045c 100644--- a/autogpt_platform/backend/backend/executor/scheduler.py+++ b/autogpt_platform/backend/backend/executor/scheduler.py@@ -269,9 +269,7 @@ class Scheduler(AppService):self.scheduler = BackgroundScheduler(executors={- "default": ThreadPoolExecutor(- max_workers=self.db_pool_size()- ), # Match DB pool size to prevent resource contention+ "default": ThreadPoolExecutor(max_workers=10), # Max 10 concurrent jobs},job_defaults={"coalesce": True, # Skip redundant missed jobs - just run the latestdiff --git a/autogpt_platform/backend/backend/executor/utils.py b/autogpt_platform/backend/backend/executor/utils.pyindex fca220a43e..000a784d41 100644--- a/autogpt_platform/backend/backend/executor/utils.py+++ b/autogpt_platform/backend/backend/executor/utils.py@@ -548,7 +548,7 @@ async def validate_graph_with_credentials(return node_input_errors-async def _construct_starting_node_execution_input(+async def _construct_node_execution_input(graph: GraphModel,user_id: str,graph_inputs: BlockInput,@@ -622,7 +622,7 @@ async def validate_and_construct_node_execution_input(graph_version: Optional[int] = None,graph_credentials_inputs: Optional[dict[str, CredentialsMetaInput]] = None,nodes_input_masks: Optional[dict[str, dict[str, JsonValue]]] = None,-) -> tuple[GraphModel, list[tuple[str, BlockInput]], dict[str, dict[str, JsonValue]]]:+) -> tuple[GraphModel, list[tuple[str, BlockInput]]]:"""Public wrapper that handles graph fetching, credential mapping, and validation+construction.This centralizes the logic used by both scheduler validation and actual execution.@@ -666,14 +666,14 @@ async def validate_and_construct_node_execution_input(nodes_input_masks or {},)- starting_nodes_input = await _construct_starting_node_execution_input(+ starting_nodes_input = await _construct_node_execution_input(graph=graph,user_id=user_id,graph_inputs=graph_inputs,nodes_input_masks=nodes_input_masks,)- return graph, starting_nodes_input, nodes_input_masks+ return graph, starting_nodes_inputdef _merge_nodes_input_masks(@@ -856,15 +856,13 @@ async def add_graph_execution(else:edb = get_database_manager_async_client()- graph, starting_nodes_input, nodes_input_masks = (- await validate_and_construct_node_execution_input(- graph_id=graph_id,- user_id=user_id,- graph_inputs=inputs or {},- graph_version=graph_version,- graph_credentials_inputs=graph_credentials_inputs,- nodes_input_masks=nodes_input_masks,- )+ graph, starting_nodes_input = await validate_and_construct_node_execution_input(+ graph_id=graph_id,+ user_id=user_id,+ graph_inputs=inputs or {},+ graph_version=graph_version,+ graph_credentials_inputs=graph_credentials_inputs,+ nodes_input_masks=nodes_input_masks,)graph_exec = Nonediff --git a/autogpt_platform/backend/backend/server/routers/v1.py b/autogpt_platform/backend/backend/server/routers/v1.pyindex 9bcbe07aef..8460d2eebc 100644--- a/autogpt_platform/backend/backend/server/routers/v1.py+++ b/autogpt_platform/backend/backend/server/routers/v1.py@@ -676,15 +676,7 @@ async def update_graph(# Handle deactivation of the previously active versionawait on_graph_deactivate(current_active_version, user_id=user_id)- # Fetch new graph version *with sub-graphs* (needed for credentials input schema)- new_graph_version_with_subgraphs = await graph_db.get_graph(- graph_id,- new_graph_version.version,- user_id=user_id,- include_subgraphs=True,- )- assert new_graph_version_with_subgraphs # make type checker happy- return new_graph_version_with_subgraphs+ return new_graph_version@v1_router.put(diff --git a/autogpt_platform/backend/backend/server/v2/library/db.py b/autogpt_platform/backend/backend/server/v2/library/db.pyindex ac529ed53c..89028100e4 100644--- a/autogpt_platform/backend/backend/server/v2/library/db.py+++ b/autogpt_platform/backend/backend/server/v2/library/db.py@@ -241,11 +241,7 @@ async def get_library_agent_by_graph_id()if not agent:return None-- assert agent.AgentGraph # make type checker happy- # Include sub-graphs so we can make a full credentials input schema- sub_graphs = await graph_db.get_sub_graphs(agent.AgentGraph)- return library_model.LibraryAgent.from_db(agent, sub_graphs=sub_graphs)+ return library_model.LibraryAgent.from_db(agent)except prisma.errors.PrismaError as e:logger.error(f"Database error fetching library agent by graph ID: {e}")raise store_exceptions.DatabaseError("Failed to fetch library agent") from ediff --git a/autogpt_platform/backend/backend/util/exceptions.py b/autogpt_platform/backend/backend/util/exceptions.pyindex 8888650a82..b0ffbfe428 100644--- a/autogpt_platform/backend/backend/util/exceptions.py+++ b/autogpt_platform/backend/backend/util/exceptions.py@@ -71,10 +71,4 @@ class GraphValidationError(ValueError):self.node_errors = node_errors or {}def __str__(self):- return self.message + "".join(- [- f"\n {node_id}:"- + "".join([f"\n {k}: {e}" for k, e in errors.items()])- for node_id, errors in self.node_errors.items()- ]- )+ return self.message