From 1835a1dc5d3dc3592f33a9c07dc932b5fa9a4f88 Mon Sep 17 00:00:00 2001 From: Yansong Zhang <916125788@qq.com> Date: Wed, 8 Apr 2026 13:19:59 +0800 Subject: [PATCH] fix(api): allow AGENT mode in workflow features validation Add AppMode.AGENT to validate_features_structure() match case alongside ADVANCED_CHAT, fixing 'Invalid app mode: agent' error when creating Agent apps (which auto-generate a workflow draft). Discovered during E2E testing of the full create -> draft -> publish flow. Made-with: Cursor --- api/services/workflow_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/services/workflow_service.py b/api/services/workflow_service.py index 5301491df7..e8ccade439 100644 --- a/api/services/workflow_service.py +++ b/api/services/workflow_service.py @@ -1418,7 +1418,7 @@ class WorkflowService: def validate_features_structure(self, app_model: App, features: dict): match app_model.mode: - case AppMode.ADVANCED_CHAT: + case AppMode.ADVANCED_CHAT | AppMode.AGENT: return AdvancedChatAppConfigManager.config_validate( tenant_id=app_model.tenant_id, config=features, only_structure_validate=True )