Execute 执行子 Agent 任务
(ctx context.Context, req *types.SubAgentRequest)
| 63 | |
| 64 | // Execute 执行子 Agent 任务 |
| 65 | func (w *SubAgentExecutorWrapper) Execute(ctx context.Context, req *types.SubAgentRequest) (*types.SubAgentResult, error) { |
| 66 | // 确保请求使用正确的 agent type |
| 67 | req.AgentType = w.agentType |
| 68 | return w.manager.Execute(ctx, req) |
| 69 | } |
| 70 | |
| 71 | // InitializeTaskExecutor 初始化 Task 执行器 |
| 72 | // 应用层在启动时调用此函数,将 SubAgentManager 注入到 Task 工具 |