Optimize agent planning and subagent runtime

This commit is contained in:
lpf
2026-03-09 12:33:00 +08:00
parent acf8a22c0a
commit d1abd73e63
11 changed files with 984 additions and 108 deletions

View File

@@ -38,10 +38,11 @@ func (al *AgentLoop) maybeAutoRoute(ctx context.Context, msg bus.InboundMessage)
waitCtx, cancel := context.WithTimeout(ctx, time.Duration(waitTimeout)*time.Second)
defer cancel()
task, err := al.subagentRouter.DispatchTask(waitCtx, tools.RouterDispatchRequest{
Task: taskText,
AgentID: agentID,
OriginChannel: msg.Channel,
OriginChatID: msg.ChatID,
Task: taskText,
AgentID: agentID,
NotifyMainPolicy: "internal_only",
OriginChannel: msg.Channel,
OriginChatID: msg.ChatID,
})
if err != nil {
return "", true, err