feat(agent): add_hint 触发的规划轮显式播报「本轮由新增 hint 触发」
此前 add_hint 走裸 notify,触发的规划轮 triggers 为空,开场白说"无具体变动", hint 只折在 graph_overview 里让 planner 自己发现。仿照 set_goals/NotifyGoal, 让 add_hint 记一条 hint 触发事件并带上提示文本。 - TriggerEvent 增加 Hints 字段;renderTriggers 增加 hint 分支,播报「人新增了 N 条战略提示:…」 - ToolSet 增加 notifyHint 回调 + SetNotifyHint;add_hint 整批写完统一唤醒一次 (优先 notifyHint,未接则退回裸 notify),notify 从 addOneHint 上移到 handler - 主 agent(server.go) 与跨任务编排(orchestration.go) 均接上 Task.NotifyHint
This commit is contained in:
1 parent
0b9341ac8b
commit
edbc296e29
6 files changed
+55
-9
No files matched your search
+1
-1
@@ -3571,7 +3571,7 @@ func (s *Server) chat(w http.ResponseWriter, r *http.Request) {
|
||||
taskDir := filepath.Join(s.m.dir, "tasks", t.ID)
|
||||
agentMsg := composeAgentMessage(req.Message, req.Attachments, taskDir)
|
||||
s.engine.BeginLLMCall(t.ID)
|
||||
_, err := ma.Chat(ctx, maTaskID, mainSeg, s.m.Assets(), t.Store, t.Goal, agentMsg, emit, t.Notify, resume, t.NotifyGoal)
|
||||
_, err := ma.Chat(ctx, maTaskID, mainSeg, s.m.Assets(), t.Store, t.Goal, agentMsg, emit, t.Notify, resume, t.NotifyGoal, t.NotifyHint)
|
||||
s.engine.EndLLMCall(t.ID)
|
||||
if err != nil && ctx.Err() == nil {
|
||||
s.engine.emitActivity(t, db.Activity{Worker: "mainagent", Kind: "text", IsError: true, Summary: "(主 Agent 出错:" + err.Error() + ")", MainSeg: segPtr})
|
||||
|
||||
Reference in new issue
Block a user