Skip to content

Self-improving AI Employees for everyone

refactor: hygiene cleanup - dedupe constants, drop dead getters, retire gmail alias (Wave 11.I, P)

trohitg297b48fa8a19
diff --git a/client/src/Dashboard.tsx b/client/src/Dashboard.tsx
index fd7df321..051eca2e 100644
--- a/client/src/Dashboard.tsx
+++ b/client/src/Dashboard.tsx
@@ -632,8 +632,8 @@ const DashboardContent: React.FC = () => {
if (!currentWorkflow) return;
// Check if there's at least one trigger node (workflow entry points)
- // Trigger types: start, cronScheduler, webhookTrigger, whatsappReceive, telegramReceive, twitterReceive, gmailReceive, workflowTrigger, chatTrigger, taskTrigger
- const triggerTypes = ['start', 'cronScheduler', 'webhookTrigger', 'whatsappReceive', 'telegramReceive', 'twitterReceive', 'gmailReceive', 'emailReceive', 'workflowTrigger', 'chatTrigger', 'taskTrigger'];
+ // Trigger types: start, cronScheduler, webhookTrigger, whatsappReceive, telegramReceive, twitterReceive, googleGmailReceive, workflowTrigger, chatTrigger, taskTrigger
+ const triggerTypes = ['start', 'cronScheduler', 'webhookTrigger', 'whatsappReceive', 'telegramReceive', 'twitterReceive', 'googleGmailReceive', 'emailReceive', 'workflowTrigger', 'chatTrigger', 'taskTrigger'];
const hasTriggerNode = nodes.some(node => triggerTypes.includes(node.type || ''));
if (!hasTriggerNode) {
alert('No trigger node found in workflow.\n\nAdd a trigger node (Cron Scheduler, WhatsApp Receive, Webhook, Chat Trigger, etc.) to begin deployment.');
diff --git a/server/constants.py b/server/constants.py
index 4d42c576..b5780fd1 100644
--- a/server/constants.py
+++ b/server/constants.py
@@ -317,7 +317,7 @@ TRIGGER_TYPES: FrozenSet[str] = EVENT_TRIGGER_TYPES
# unlike push-based triggers (WhatsApp, Webhook) that receive events externally.
# In deployment mode, these get a dedicated polling loop instead of event_waiter.
POLLING_TRIGGER_TYPES: FrozenSet[str] = frozenset([
- 'gmailReceive',
+ 'googleGmailReceive',
'twitterReceive',
'emailReceive',
])
@@ -340,7 +340,7 @@ WORKFLOW_TRIGGER_TYPES: FrozenSet[str] = frozenset([
'chatTrigger',
'taskTrigger',
'twitterReceive',
- 'gmailReceive',
+ 'googleGmailReceive',
'telegramReceive',
'emailReceive',
])
diff --git a/server/nodes/google/__init__.py b/server/nodes/google/__init__.py
index c765da6c..e9e970c8 100644
--- a/server/nodes/google/__init__.py
+++ b/server/nodes/google/__init__.py
@@ -46,7 +46,7 @@ from ._refresh import refresh_google_status
register_ws_handlers(WS_HANDLERS)
register_router(_router.router, name="google")
register_service_refresh(refresh_google_status)
-register_filter_builder("gmailReceive", build_gmail_filter)
+register_filter_builder("googleGmailReceive", build_gmail_filter)
# loadOptionsMethod loaders (Wave 11.I, milestone M.2).
register_option_loader("gmailLabels", load_gmail_labels)
diff --git a/server/nodes/google/gmail_receive.py b/server/nodes/google/gmail_receive.py
index 319fff5b..5e07c3a1 100644
--- a/server/nodes/google/gmail_receive.py
+++ b/server/nodes/google/gmail_receive.py
@@ -56,10 +56,14 @@ class GmailReceiveOutput(BaseModel):
class GmailReceiveNode(PollingTriggerNode):
type = "googleGmailReceive"
- # Pre-existing alias used by deployment manager + POLLING_TRIGGER_TYPES;
- # registers the deployment-mode poll factory under both names so the
- # mismatch can be retired in a separate rename commit.
- type_alias = "gmailReceive"
+ # Wave 11.I, milestone P: ``event_type`` ClassVar lets
+ # ``event_waiter._auto_populate_from_plugins`` backfill
+ # TRIGGER_REGISTRY without a hardcoded entry in event_waiter. The
+ # legacy ``type_alias = "gmailReceive"`` shim was retired -- the
+ # downstream callers (POLLING_TRIGGER_TYPES, deployment manager,
+ # frontend trigger list, _filters registration) all rename to the
+ # canonical class type in the same commit.
+ event_type = "gmail_email_received"
display_name = "Gmail Receive"
subtitle = "Inbound Email"
group = ("google", "trigger")
@@ -201,5 +205,5 @@ class GmailReceiveNode(PollingTriggerNode):
@Operation("wait")
async def wait(self, ctx: NodeContext, params: GmailReceiveParams) -> GmailReceiveOutput:
raise NotImplementedError(
- "gmailReceive uses execute() override (Wave 11.D.5 inlined)."
+ "googleGmailReceive uses execute() override (Wave 11.D.5 inlined)."
)
diff --git a/server/services/deployment/manager.py b/server/services/deployment/manager.py
index 5f1a8e50..09b6c5c6 100644
--- a/server/services/deployment/manager.py
+++ b/server/services/deployment/manager.py
@@ -13,7 +13,7 @@ from datetime import datetime
from typing import Dict, Any, List, Optional, Callable, TYPE_CHECKING
from core.logging import get_logger
-from constants import WORKFLOW_TRIGGER_TYPES, POLLING_TRIGGER_TYPES
+from constants import POLLING_TRIGGER_TYPES, TOOLKIT_NODE_TYPES, WORKFLOW_TRIGGER_TYPES
from services import event_waiter
from .state import DeploymentState, TriggerInfo
from .triggers import TriggerManager
@@ -649,10 +649,12 @@ class DeploymentManager:
continue
downstream_ids.add(source)
- # Include sub-nodes connected to toolkit nodes (n8n Sub-Node pattern)
- # Android service nodes connect to androidTool's input-main, not config handles
- # These need to be included so the toolkit can discover its connected services
- toolkit_node_ids = {n['id'] for n in nodes if n.get('type') == 'androidTool' and n['id'] in downstream_ids}
+ # Include sub-nodes connected to toolkit nodes (n8n Sub-Node pattern).
+ # Service nodes connect to a toolkit's input-main (not a config
+ # handle) and need to be included so the toolkit can discover
+ # them. ``TOOLKIT_NODE_TYPES`` is the canonical set; today only
+ # ``androidTool`` is in it.
+ toolkit_node_ids = {n['id'] for n in nodes if n.get('type') in TOOLKIT_NODE_TYPES and n['id'] in downstream_ids}
for edge in edges:
target = edge.get('target')
source = edge.get('source')
diff --git a/server/services/event_waiter.py b/server/services/event_waiter.py
index f8928cc8..d096aba2 100644
--- a/server/services/event_waiter.py
+++ b/server/services/event_waiter.py
@@ -106,21 +106,14 @@ TRIGGER_REGISTRY: Dict[str, TriggerConfig] = {
event_type='task_completed',
display_name='Task Completed'
),
- # Pre-existing type-name mismatch — the plugin class is
- # ``googleGmailReceive`` but downstream callers (deployment
- # manager, this registry) key by ``gmailReceive``. Auto-populate
- # would key by the class type, so an alias entry stays here until
- # the gmail plugin renames its type.
- 'gmailReceive': TriggerConfig(
- node_type='gmailReceive',
- event_type='gmail_email_received',
- display_name='Gmail Email'
- ),
# Plugin-owned trigger entries (whatsappReceive, twitterReceive,
- # telegramReceive, emailReceive) live in their plugin folders'
- # ``_filters.py`` and are backfilled here from each plugin's
- # ``event_type`` ClassVar via ``_auto_populate_from_plugins``
- # (Wave 11.I, milestone K).
+ # telegramReceive, emailReceive, googleGmailReceive) live in their
+ # plugin folders' ``_filters.py`` and are backfilled here from each
+ # plugin's ``event_type`` ClassVar via
+ # ``_auto_populate_from_plugins`` (Wave 11.I, milestone K). Gmail's
+ # explicit alias entry was retired in milestone P after the
+ # downstream callers (POLLING_TRIGGER_TYPES, deployment manager,
+ # frontend trigger list) were renamed to the canonical class type.
# Future triggers - just add to registry:
# 'mqttTrigger': TriggerConfig('mqttTrigger', 'mqtt_message', 'MQTT Message'),
}
@@ -305,7 +298,7 @@ def build_task_completed_filter(params: Dict) -> Callable[[Dict], bool]:
# **framework-level** triggers (webhook + chat + delegated-task) --
# they don't belong to any one plugin domain and intentionally stay
# here. The plugin entries (whatsappReceive, twitterReceive,
-# gmailReceive, emailReceive) live in their plugin folders'
+# googleGmailReceive, emailReceive) live in their plugin folders'
# ``_filters.py`` and self-register at import time.
FILTER_BUILDERS: Dict[str, Callable[[Dict], Callable[[Dict], bool]]] = {
'webhookTrigger': build_webhook_filter,
diff --git a/server/services/plugin/polling.py b/server/services/plugin/polling.py
index 327f704f..7575b2b4 100644
--- a/server/services/plugin/polling.py
+++ b/server/services/plugin/polling.py
@@ -70,9 +70,9 @@ class PollingTriggerNode(TriggerNode, abstract=True):
``poll_interval`` param. Default (10, 3600).
- :attr:`type_alias` -- a second registration key for plugins
that want to be reachable by a legacy type name without
- changing the plugin's primary ``type``. Today's only use case
- is gmail (``type = "googleGmailReceive"`` but downstream
- callers key by ``"gmailReceive"``).
+ changing the plugin's primary ``type``. Currently unused after
+ Wave 11.I milestone P retired the gmail alias; kept on the base
+ class as a documented escape hatch for future renames.
"""
mode: ClassVar[str] = "polling"
diff --git a/server/services/status_broadcaster.py b/server/services/status_broadcaster.py
index c1ad7e56..19d7275f 100644
--- a/server/services/status_broadcaster.py
+++ b/server/services/status_broadcaster.py
@@ -345,10 +345,6 @@ class StatusBroadcaster:
"data": self._status["whatsapp"]
})
- def get_whatsapp_status(self) -> Dict[str, Any]:
- """Get WhatsApp connection status."""
- return self._status["whatsapp"].copy()
-
# =========================================================================
# Telegram Status Updates
# =========================================================================
@@ -377,10 +373,6 @@ class StatusBroadcaster:
"data": self._status["telegram"]
})
- def get_telegram_status(self) -> Dict[str, Any]:
- """Get Telegram bot connection status."""
- return self._status["telegram"].copy()
-
# =========================================================================
# Node Status Updates
# =========================================================================
diff --git a/server/services/temporal/workflow.py b/server/services/temporal/workflow.py
index c0e1828a..34d774e1 100644
--- a/server/services/temporal/workflow.py
+++ b/server/services/temporal/workflow.py
@@ -25,13 +25,13 @@ CONFIG_HANDLES = {"input-tools", "input-memory", "input-model", "input-skill", "
# Trigger node types — event listeners that should never be scheduled
# as blocking activities. Imported from constants to avoid drift (was
# previously redefined here with a "keep in sync" comment — Wave 11.E.2).
-from constants import WORKFLOW_TRIGGER_TYPES as TRIGGER_NODE_TYPES
-
-# Android service types (connect to androidTool, not executed directly)
-ANDROID_SERVICE_TYPES = {
- "batteryMonitor", "locationService", "deviceState",
- "systemInfo", "appList", "appLauncher",
-}
+# Android service types follow the same pattern: imported from constants
+# so the canonical 16-entry list (Wave 11.I, milestone P -- the local
+# 6-entry copy that lived here was a stale subset).
+from constants import (
+ ANDROID_SERVICE_NODE_TYPES as ANDROID_SERVICE_TYPES,
+ WORKFLOW_TRIGGER_TYPES as TRIGGER_NODE_TYPES,
+)
# Skill node types (connect to Zeenie's input-skill, not executed directly)
SKILL_NODE_TYPES = {