feat(workflow): 增加会话级多智能体任务规划运行能力

提交范围聚焦于工作流编排新增:新增 workflow_planning 路由与前后端运行入口(workflow_planning.py、workflow_proposal_planner.py、workflow_deep_research_adapter.py),支持基于会话的提案-规划-执行流程,满足任务驱动式多智能体协作。

完成网关层运行时适配:扩展 workflow_resource_checks、workflow_executor、workflow_runs、workflow_agent_runner 与依赖注入,新增/更新配置(config.yaml、workflow_config),并补充 lead_agent 路径与节点实现,确保 Planner 与普通工作流运行态衔接一致。

补齐持久化与建模:新增 workflow_planning 持久化模块与 MySQL migration(20260831_01_workflow_planning_sessions),注册 SQL 与模型、内存 store,并扩展错误/表达式/validator/节点语义以承载新会话态输入输出。

增强文档与测试:新增会话式多智能体编排中文说明、更新开发文档与 AGENTS 指南、补充 workflow_engine/workflow_runs 回归测试,提高新路径的行为可验证性;同时留存 seed 资产(workflow-planner)便于一体化部署。
This commit is contained in:
董宏凯 committed 2026-09-01 11:47:30 +08:00
1 parent ac92f29db1
commit 1706a24182
39 files changed
+4896 -81

No files matched your search

@@ -61,8 +61,12 @@ class WorkflowAgentRunner:
on_delta: Callable[[str], Awaitable[None]] | None = None,
on_tool: Callable[[dict[str, Any]], Awaitable[None]] | None = None,
model_name: str | None = None,
disable_tools: bool = False,
thinking_enabled: bool | None = None,
force_disable_thinking: bool = False,
) -> dict[str, Any]:
from deerflow.agents.lead_agent.agent import make_lead_agent
from deerflow.config.app_config import get_app_config
thread_id = _thread_id(run_id, node_id, thread_mode)
configurable: dict[str, Any] = {
@@ -73,12 +77,23 @@ class WorkflowAgentRunner:
"model_name": model_name or "",
# Workflow nodes are non-interactive: no plan mode, no clarification.
"is_plan_mode": False,
# Control-plane callers (such as candidate planning) may need a
# model's reasoning but must not expose any callable capability.
"disable_tools": disable_tools,
"thinking_force_disabled": force_disable_thinking,
"workflow_run_id": run_id,
"workflow_node_id": node_id,
}
if thinking_enabled is not None:
configurable["thinking_enabled"] = thinking_enabled
if skill_names:
configurable["skill_names"] = list(skill_names)
config = {"configurable": configurable, "recursion_limit": 60}
# Tool-using research agents need more than the old chat-sized 60
# super-steps (each model → tool exchange is roughly two steps).
config = {
"configurable": configurable,
"recursion_limit": get_app_config().workflows.agent_recursion_limit,
}
try:
agent = make_lead_agent(config)