feat(agent): 实现委派工具重构,支持子代理和代理团队模式

- 新增 spawn_subagent 和 spawn_agent_team 工具,替代原有的 spawn 工具
- 重构 DelegationManager 以支持单个子代理和代理团队两种委派模式
- 更新系统提示词中的委派策略说明,明确使用场景和区别
- 添加技能上下文传递功能,确保委派任务遵循指定技能
- 实现代理内部的受控下游委派机制,防止无限嵌套
- 更新工具注册和上下文设置逻辑以适配新架构
This commit is contained in:
2026-03-30 17:21:39 +08:00
parent 29dfd14aa6
commit fee9007da6
6 changed files with 490 additions and 90 deletions

View File

@ -17,7 +17,7 @@ Only use this skill if Outlook MCP tools are available in the current tool list,
## V1 routing rules
- Keep Outlook execution in the main agent turn.
- Do not `spawn` a local subagent for Outlook work in V1, because the local delegated agent does not inherit MCP tools.
- Do not use `spawn_subagent` for Outlook work in V1, because the local delegated agent does not inherit MCP tools.
- Do not use the built-in `email` channel for Outlook mailbox operations. Outlook actions should go through MCP -> Outlook MCP server -> Microsoft Graph.
## Tool usage rules