feat: 工作流画布支持草稿试运行(target=draft 执行当前草稿图)

This commit is contained in:
董宏凯 committed 2026-08-30 20:02:15 +08:00
1 parent 3384f2e51c
commit 222595d6c4
7 files changed
+198 -32

No files matched your search

@@ -117,10 +117,10 @@ async def build_resource_catalog(request: Request, *, user_id: str) -> ResourceC
def _check_agent(config: dict[str, Any], catalog: ResourceCatalog) -> dict[str, Any] | None:
agent_id = str(config.get("agentId") or config.get("agent_id") or "")
if not agent_id:
return _issue("未选择智能体", "config.agentId")
if agent_id not in catalog.agent_ids:
# Empty agentId means the runtime's built-in default agent — a real,
# executable fallback, not missing configuration.
agent_id = str(config.get("agentId") or config.get("agent_id") or "") or "default"
if agent_id != "default" and agent_id not in catalog.agent_ids:
return _issue("未选择可访问的智能体", "config.agentId")
if not str(config.get("promptTemplate") or config.get("prompt_template") or "").strip():
return _issue("智能体节点的提示词不能为空", "config.promptTemplate")
@@ -138,10 +138,8 @@ def _check_skill(config: dict[str, Any], catalog: ResourceCatalog) -> dict[str,
mode = str(config.get("mode") or "agent_skill")
if mode != "agent_skill":
return _issue("callable_skill 模式暂未开放执行,请改用 agent_skill", "config.mode")
agent_id = str(config.get("agentId") or config.get("agent_id") or "")
if not agent_id:
return _issue("技能节点未选择智能体", "config.agentId")
if agent_id not in catalog.agent_ids:
agent_id = str(config.get("agentId") or config.get("agent_id") or "") or "default"
if agent_id != "default" and agent_id not in catalog.agent_ids:
return _issue("技能节点引用的智能体不可访问", "config.agentId")
skill_names = [str(s) for s in (config.get("skillNames") or config.get("skill_names") or [])]
if not skill_names: