Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
fix: ai_employee missing from 5 backend dispatch points + execution layer bugs for team lead agents
trohitg51f614cbce4e
diff --git a/client/src/components/parameterPanel/InputSection.tsx b/client/src/components/parameterPanel/InputSection.tsxindex 9d39b665..69afce91 100644--- a/client/src/components/parameterPanel/InputSection.tsx+++ b/client/src/components/parameterPanel/InputSection.tsx@@ -89,7 +89,7 @@ const InputSection: React.FC<InputSectionProps> = ({ nodeId, visible = true }) ='aiAgent', 'chatAgent', 'android_agent', 'coding_agent','web_agent', 'task_agent', 'social_agent', 'travel_agent','tool_agent', 'productivity_agent', 'payments_agent', 'consumer_agent',- 'autonomous_agent', 'orchestrator_agent'+ 'autonomous_agent', 'orchestrator_agent', 'ai_employee'];// Check if current node is an agent that shows skills in Middle Sectionconst isAgentWithSkills = AGENT_WITH_SKILLS_TYPES.includes(currentNodeType || '');@@ -691,7 +691,7 @@ const InputSection: React.FC<InputSectionProps> = ({ nodeId, visible = true }) =const isMemory = nodeType === 'simpleMemory';const nodeTypeLower = nodeType.toLowerCase();// AI agent types that use the AI output schema- const aiAgentTypes = ['aiAgent', 'chatAgent', 'android_agent', 'coding_agent', 'web_agent', 'task_agent', 'social_agent', 'travel_agent', 'tool_agent', 'productivity_agent', 'payments_agent', 'consumer_agent', 'autonomous_agent', 'orchestrator_agent'];+ const aiAgentTypes = ['aiAgent', 'chatAgent', 'android_agent', 'coding_agent', 'web_agent', 'task_agent', 'social_agent', 'travel_agent', 'tool_agent', 'productivity_agent', 'payments_agent', 'consumer_agent', 'autonomous_agent', 'orchestrator_agent', 'ai_employee'];const isAI = !isMemory && (nodeTypeLower.includes('chatmodel') || aiAgentTypes.includes(nodeType));const isFile = nodeType.includes('file');const isWhatsAppDb = nodeType === 'whatsappDb';diff --git a/client/src/components/parameterPanel/MiddleSection.tsx b/client/src/components/parameterPanel/MiddleSection.tsxindex df5a3060..992b77a3 100644--- a/client/src/components/parameterPanel/MiddleSection.tsx+++ b/client/src/components/parameterPanel/MiddleSection.tsx@@ -31,7 +31,8 @@ const AGENT_WITH_SKILLS_TYPES = ['payments_agent','consumer_agent','autonomous_agent',- 'orchestrator_agent'+ 'orchestrator_agent',+ 'ai_employee'];interface ConnectedSkill {diff --git a/server/services/ai.py b/server/services/ai.pyindex fe05a23e..2b378d95 100644--- a/server/services/ai.py+++ b/server/services/ai.py@@ -2471,6 +2471,7 @@ class AIService:'consumer_agent': 'delegate_to_consumer_agent','autonomous_agent': 'delegate_to_autonomous_agent','orchestrator_agent': 'delegate_to_orchestrator_agent',+ 'ai_employee': 'delegate_to_ai_employee',# Android service nodes (direct tool usage)'batteryMonitor': 'android_battery','networkMonitor': 'android_network',@@ -2536,6 +2537,7 @@ class AIService:'consumer_agent': 'ONE-SHOT delegation to Consumer Agent. Call ONCE per task, returns task_id. Agent works in background - do NOT re-call.','autonomous_agent': 'ONE-SHOT delegation to Autonomous Agent. Call ONCE per task, returns task_id. Agent works in background using Code Mode patterns - do NOT re-call.','orchestrator_agent': 'ONE-SHOT delegation to Orchestrator Agent. Call ONCE per task, returns task_id. Coordinates multiple agents - do NOT re-call.',+ 'ai_employee': 'ONE-SHOT delegation to AI Employee. Call ONCE per task, returns task_id. Coordinates multiple agents - do NOT re-call.',# Android service nodes (direct tool usage)'batteryMonitor': 'Monitor Android battery status, level, charging state, temperature, and health.','networkMonitor': 'Monitor Android network connectivity, type, and internet availability.',@@ -3403,7 +3405,7 @@ class AIService:return CheckDelegatedTasksSchema# AI Agent delegation schema (fire-and-forget async delegation)- if node_type in ('aiAgent', 'chatAgent', 'android_agent', 'coding_agent', 'web_agent', 'task_agent', 'social_agent', 'travel_agent', 'tool_agent', 'productivity_agent', 'payments_agent', 'consumer_agent', 'autonomous_agent', 'orchestrator_agent'):+ if node_type in ('aiAgent', 'chatAgent', 'android_agent', 'coding_agent', 'web_agent', 'task_agent', 'social_agent', 'travel_agent', 'tool_agent', 'productivity_agent', 'payments_agent', 'consumer_agent', 'autonomous_agent', 'orchestrator_agent', 'ai_employee'):agent_label = params.get('label', node_type)class DelegateToAgentSchema(BaseModel):diff --git a/server/services/execution/executor.py b/server/services/execution/executor.pyindex f721af68..9a2bec12 100644--- a/server/services/execution/executor.py+++ b/server/services/execution/executor.py@@ -888,7 +888,7 @@ class WorkflowExecutor:Returns:List of layers, where each layer is a list of node IDs"""- from constants import CONFIG_NODE_TYPES, TOOLKIT_NODE_TYPES+ from constants import CONFIG_NODE_TYPES, TOOLKIT_NODE_TYPES, AI_AGENT_TYPES# Build node type lookup for trigger detectionnode_types: Dict[str, str] = {@@ -898,8 +898,8 @@ class WorkflowExecutor:# Find toolkit sub-nodes (nodes that connect TO a toolkit)toolkit_node_ids = {n.get("id") for n in nodes if n.get("type") in TOOLKIT_NODE_TYPES}- # Find AI Agent nodes (both aiAgent and chatAgent have config handles)- ai_agent_node_ids = {n.get("id") for n in nodes if n.get("type") in ('aiAgent', 'chatAgent')}+ # Find AI Agent nodes (all agent types have config handles)+ ai_agent_node_ids = {n.get("id") for n in nodes if n.get("type") in AI_AGENT_TYPES}subnode_ids: set = set()for edge in edges:@@ -911,10 +911,10 @@ class WorkflowExecutor:if target in toolkit_node_ids and source:subnode_ids.add(source)- # Nodes connected to AI Agent/Zeenie config handles are sub-nodes- # These handles: input-memory, input-tools, input-skill+ # Nodes connected to AI Agent config handles are sub-nodes+ # These handles: input-memory, input-tools, input-skill, input-teammatesif target in ai_agent_node_ids and source and target_handle:- if target_handle in ('input-memory', 'input-tools', 'input-skill'):+ if target_handle in ('input-memory', 'input-tools', 'input-skill', 'input-teammates'):subnode_ids.add(source)# Filter out config nodes and sub-nodes from executiondiff --git a/server/services/execution/models.py b/server/services/execution/models.pyindex 820cfae2..36f5812d 100644--- a/server/services/execution/models.py+++ b/server/services/execution/models.py@@ -312,7 +312,7 @@ class ExecutionContext:Toolkit sub-nodes (nodes connected TO a toolkit like androidTool) are alsoexcluded - they execute only when called via the toolkit's tool interface."""- from constants import CONFIG_NODE_TYPES, TOOLKIT_NODE_TYPES+ from constants import CONFIG_NODE_TYPES, TOOLKIT_NODE_TYPES, AI_AGENT_TYPESexecution_id = str(uuid.uuid4())ctx = cls(@@ -327,8 +327,8 @@ class ExecutionContext:# These should only execute when called via the toolkit, not as workflow nodestoolkit_node_ids = {n.get("id") for n in (nodes or []) if n.get("type") in TOOLKIT_NODE_TYPES}- # Find AI Agent nodes (both aiAgent and chatAgent have config handles)- ai_agent_node_ids = {n.get("id") for n in (nodes or []) if n.get("type") in ('aiAgent', 'chatAgent')}+ # Find AI Agent nodes (all agent types have config handles)+ ai_agent_node_ids = {n.get("id") for n in (nodes or []) if n.get("type") in AI_AGENT_TYPES}subnode_ids: set = set()for edge in (edges or []):@@ -340,10 +340,10 @@ class ExecutionContext:if target in toolkit_node_ids and source:subnode_ids.add(source)- # Nodes connected to AI Agent/Zeenie config handles are sub-nodes- # These handles: input-memory, input-tools, input-skill+ # Nodes connected to AI Agent config handles are sub-nodes+ # These handles: input-memory, input-tools, input-skill, input-teammatesif target in ai_agent_node_ids and source and target_handle:- if target_handle in ('input-memory', 'input-tools', 'input-skill'):+ if target_handle in ('input-memory', 'input-tools', 'input-skill', 'input-teammates'):subnode_ids.add(source)# Initialize node executions for all nodes (excluding config nodes and sub-nodes)diff --git a/server/services/handlers/tools.py b/server/services/handlers/tools.pyindex 71c4fd8a..48f979a0 100644--- a/server/services/handlers/tools.py+++ b/server/services/handlers/tools.py@@ -190,7 +190,7 @@ async def execute_tool(tool_name: str, tool_args: Dict[str, Any],# AI Agent delegation (fire-and-forget async delegation)# Includes specialized agents: android_agent, coding_agent, web_agent, task_agent, social_agent, autonomous_agent- if node_type in ('aiAgent', 'chatAgent', 'android_agent', 'coding_agent', 'web_agent', 'task_agent', 'social_agent', 'travel_agent', 'tool_agent', 'productivity_agent', 'payments_agent', 'consumer_agent', 'autonomous_agent', 'orchestrator_agent'):+ if node_type in ('aiAgent', 'chatAgent', 'android_agent', 'coding_agent', 'web_agent', 'task_agent', 'social_agent', 'travel_agent', 'tool_agent', 'productivity_agent', 'payments_agent', 'consumer_agent', 'autonomous_agent', 'orchestrator_agent', 'ai_employee'):return await _execute_delegated_agent(tool_args, config)# Generic fallback for unknown node types