Implement debug_mode for email delivery (vibe-kanban f32190a0)

The EmailDeliveryConfig in api/core/workflow/nodes/human\_input/entities.py has a field `debug_mode`. When this field is set to `True` in `node_data`, the test run (InvokeFrom.DEBUGGER) and the delivery test should only sent test emails to the current user, instead of sending to the specified recipients.

Please implement this logic, write correspond test cases to ensure that the logic works as expected.
This commit is contained in:
QuantumGhost
2026-01-15 10:21:32 +08:00
parent ea90746ed7
commit e50d849913
5 changed files with 166 additions and 7 deletions

View File

@ -27,6 +27,7 @@ from core.workflow.nodes.base.node import Node
from core.workflow.nodes.human_input.entities import (
DeliveryChannelConfig,
HumanInputNodeData,
apply_debug_email_recipient,
validate_human_input_submission,
)
from core.workflow.nodes.human_input.human_input_node import HumanInputNode
@ -918,6 +919,11 @@ class WorkflowService:
raise ValueError("Delivery method not found.")
if not delivery_method.enabled:
raise ValueError("Delivery method is disabled.")
delivery_method = apply_debug_email_recipient(
delivery_method,
enabled=True,
user_id=account.id or "",
)
rendered_content = self._render_human_input_content_for_test(
app_model=app_model,