新增worker直接对话
This commit is contained in:
1 parent
01c6d73614
commit
4157fa248b
17 files changed
+2095
-79
No files matched your search
@@ -249,6 +249,9 @@ func New(ctx context.Context, m *Manager, skillDir string, dataDir string, keyDi
|
||||
if n, _ := t.Store.ResetRunningIntents(); n > 0 {
|
||||
log.Printf("[engine] task %s 重置 %d 个残留 running 意图为 open", t.ID, n)
|
||||
}
|
||||
if err := s.engine.RecoverWorkerMessages(ctx, t); err != nil {
|
||||
log.Printf("[worker chat] task %s 恢复待处理人工消息失败: %v", t.ID, err)
|
||||
}
|
||||
if lifecycle.Paused {
|
||||
s.engine.Pause(t.ID, agent.AbortPausedOnReload)
|
||||
}
|
||||
@@ -458,6 +461,11 @@ func (s *Server) applyLLM(cfg agent.Config) error {
|
||||
s.llmOn = true
|
||||
s.cfgMu.Unlock()
|
||||
s.invalidateTaskAgents()
|
||||
for _, task := range s.m.List() {
|
||||
if err := s.engine.RecoverWorkerMessages(s.ctx, task); err != nil {
|
||||
log.Printf("[worker chat] task %s 在 LLM 就绪后恢复待处理人工消息失败: %v", task.ID, err)
|
||||
}
|
||||
}
|
||||
|
||||
// wake the active task so a task created while idle starts exploring.
|
||||
if t := s.m.ActiveTask(); t != nil {
|
||||
@@ -734,6 +742,7 @@ func (s *Server) Handler() http.Handler {
|
||||
mux.HandleFunc("PUT /api/tasks/{id}/llm", s.updateTaskLLMProfiles)
|
||||
mux.HandleFunc("GET /api/tasks/{id}/llm/resolution", s.taskLLMResolutionHandler)
|
||||
mux.HandleFunc("POST /api/tasks/{id}/intents/{iid}/control", s.controlIntent)
|
||||
mux.HandleFunc("POST /api/tasks/{id}/intents/{iid}/messages", s.sendWorkerMessage)
|
||||
mux.HandleFunc("POST /api/tasks/{id}/intents/{iid}/rerun", s.rerunIntent) // 重跑单条 blocked/exhausted/stopped 意图
|
||||
mux.HandleFunc("POST /api/tasks/{id}/intents/rerun-blocked", s.rerunBlocked) // 批量重跑本任务全部 blocked 意图
|
||||
mux.HandleFunc("POST /api/active", s.setActive)
|
||||
|
||||
Reference in new issue
Block a user