diff --git a/autogpt_platform/backend/backend/api/features/chat/tools/find_block.py b/autogpt_platform/backend/backend/api/features/chat/tools/find_block.py index 1c59f5aa2d..e2dc1f1fd8 100644 --- a/autogpt_platform/backend/backend/api/features/chat/tools/find_block.py +++ b/autogpt_platform/backend/backend/api/features/chat/tools/find_block.py @@ -13,28 +13,10 @@ from backend.api.features.chat.tools.models import ( NoResultsResponse, ) from backend.api.features.store.hybrid_search import unified_hybrid_search -from backend.data.block import BlockType, get_block +from backend.data.block import EXCLUDED_BLOCK_IDS, EXCLUDED_BLOCK_TYPES, get_block logger = logging.getLogger(__name__) -# Blocks excluded from CoPilot standalone execution -# NOTE: This does NOT affect the Builder UI which uses load_all_blocks() directly -EXCLUDED_BLOCK_TYPES = { - BlockType.INPUT, # Graph interface definition - data enters via chat, not graph inputs - BlockType.OUTPUT, # Graph interface definition - data exits via chat, not graph outputs - BlockType.WEBHOOK, # Wait for external events - would hang forever in CoPilot - BlockType.WEBHOOK_MANUAL, # Same as WEBHOOK - BlockType.NOTE, # Visual annotation only - no runtime behavior - BlockType.HUMAN_IN_THE_LOOP, # Pauses for human approval - CoPilot IS human-in-the-loop - BlockType.AGENT, # AgentExecutorBlock requires execution_context - use run_agent tool -} - -# Blocks that have STANDARD/other types but still require graph context -EXCLUDED_BLOCK_IDS = { - # SmartDecisionMakerBlock - dynamically discovers downstream blocks via graph topology - "3b191d9f-356f-482d-8238-ba04b6d18381", -} - class FindBlockTool(BaseTool): """Tool for searching available blocks.""" diff --git a/autogpt_platform/backend/backend/api/features/chat/tools/run_block.py b/autogpt_platform/backend/backend/api/features/chat/tools/run_block.py index 5685664db9..1414185ae8 100644 --- a/autogpt_platform/backend/backend/api/features/chat/tools/run_block.py +++ b/autogpt_platform/backend/backend/api/features/chat/tools/run_block.py @@ -8,11 +8,7 @@ from typing import Any from pydantic_core import PydanticUndefined from backend.api.features.chat.model import ChatSession -from backend.api.features.chat.tools.find_block import ( - EXCLUDED_BLOCK_IDS, - EXCLUDED_BLOCK_TYPES, -) -from backend.data.block import get_block +from backend.data.block import EXCLUDED_BLOCK_IDS, EXCLUDED_BLOCK_TYPES, get_block from backend.data.execution import ExecutionContext from backend.data.model import CredentialsMetaInput from backend.data.workspace import get_or_create_workspace diff --git a/autogpt_platform/backend/backend/api/features/store/content_handlers.py b/autogpt_platform/backend/backend/api/features/store/content_handlers.py index 97ddf6b0a8..eda1babeb7 100644 --- a/autogpt_platform/backend/backend/api/features/store/content_handlers.py +++ b/autogpt_platform/backend/backend/api/features/store/content_handlers.py @@ -13,10 +13,7 @@ from typing import Any from prisma.enums import ContentType -from backend.api.features.chat.tools.find_block import ( - EXCLUDED_BLOCK_IDS, - EXCLUDED_BLOCK_TYPES, -) +from backend.data.block import EXCLUDED_BLOCK_IDS, EXCLUDED_BLOCK_TYPES from backend.data.db import query_raw_with_schema logger = logging.getLogger(__name__) diff --git a/autogpt_platform/backend/backend/data/block.py b/autogpt_platform/backend/backend/data/block.py index eb9360b037..647603a567 100644 --- a/autogpt_platform/backend/backend/data/block.py +++ b/autogpt_platform/backend/backend/data/block.py @@ -76,6 +76,25 @@ class BlockType(Enum): HUMAN_IN_THE_LOOP = "Human In The Loop" +# Blocks excluded from CoPilot standalone execution +# NOTE: This does NOT affect the Builder UI which uses load_all_blocks() directly +EXCLUDED_BLOCK_TYPES = { + BlockType.INPUT, # Graph interface definition - data enters via chat, not graph inputs + BlockType.OUTPUT, # Graph interface definition - data exits via chat, not graph outputs + BlockType.WEBHOOK, # Wait for external events - would hang forever in CoPilot + BlockType.WEBHOOK_MANUAL, # Same as WEBHOOK + BlockType.NOTE, # Visual annotation only - no runtime behavior + BlockType.HUMAN_IN_THE_LOOP, # Pauses for human approval - CoPilot IS human-in-the-loop + BlockType.AGENT, # AgentExecutorBlock requires execution_context - use run_agent tool +} + +# Blocks that have STANDARD/other types but still require graph context +EXCLUDED_BLOCK_IDS = { + # SmartDecisionMakerBlock - dynamically discovers downstream blocks via graph topology + "3b191d9f-356f-482d-8238-ba04b6d18381", +} + + class BlockCategory(Enum): AI = "Block that leverages AI to perform a task." SOCIAL = "Block that interacts with social media platforms."