feat(chat): drop production bizdev import from action executor
Pending-action task runs now use stageflow request aliases and Server ports, so chat no longer reaches through the orchestration root. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,7 +29,7 @@ imports:
|
||||
- workflowdef
|
||||
chat:
|
||||
- app/chatflow
|
||||
- bizdev
|
||||
- app/stageflow
|
||||
- coordinator
|
||||
- ctxmgr
|
||||
- docgov
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"chat-agent-system/internal/bizdev"
|
||||
"chat-agent-system/internal/app/stageflow"
|
||||
"chat-agent-system/internal/coordinator"
|
||||
"chat-agent-system/internal/docgov"
|
||||
"chat-agent-system/internal/taskrun"
|
||||
@@ -16,7 +16,6 @@ import (
|
||||
// ActionServices 对话层执行 PendingAction 所需的后端服务。
|
||||
type ActionServices struct {
|
||||
DocGov *docgov.GovernanceEngine
|
||||
Bizdev bizdev.BizdevService
|
||||
TaskRuns *taskrun.Manager
|
||||
}
|
||||
|
||||
@@ -95,7 +94,7 @@ func (s *Session) executeAction(ctx context.Context, action *coordinator.Pending
|
||||
return &ActionExecResult{DocState: string(doc.CurrentState), Message: "驳回完成"}, nil
|
||||
|
||||
case "taskrun.resume", "taskrun.restart":
|
||||
if s.Actions.TaskRuns == nil || s.Actions.Bizdev == nil {
|
||||
if s.Actions.TaskRuns == nil {
|
||||
return nil, fmt.Errorf("task run services not available")
|
||||
}
|
||||
taskKey := action.TaskKey
|
||||
@@ -107,7 +106,7 @@ func (s *Session) executeAction(ctx context.Context, action *coordinator.Pending
|
||||
if action.Kind == "taskrun.resume" {
|
||||
resumeDir = action.WorkDir
|
||||
}
|
||||
taskReq := bizdev.TaskRunRequest{
|
||||
taskReq := stageflow.TaskRunRequest{
|
||||
TaskKey: taskKey,
|
||||
ProjectName: userCtx.Project.Name,
|
||||
UserID: uid,
|
||||
@@ -122,7 +121,7 @@ func (s *Session) executeAction(ctx context.Context, action *coordinator.Pending
|
||||
TaskKey: taskKey,
|
||||
Status: "running",
|
||||
}
|
||||
created, err := s.Actions.TaskRuns.CreateAndStart(ctx, runID, record, taskReq, bizdev.StageRunRequest{}, resumeDir)
|
||||
created, err := s.Actions.TaskRuns.CreateAndStart(ctx, runID, record, taskReq, stageflow.StageRunRequest{}, resumeDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -500,13 +500,10 @@ func (s *Server) getOrCreateSession(
|
||||
|
||||
sess := chat.NewSession(sessionID, userCtx, s.rec, s.engine)
|
||||
sess.ChatLog = s.chatLog
|
||||
if s.svc != nil {
|
||||
sess.CtxMgr = s.ctxMgr
|
||||
sess.Actions = &chat.ActionServices{
|
||||
DocGov: s.gov,
|
||||
Bizdev: s.svc,
|
||||
TaskRuns: s.taskRuns,
|
||||
}
|
||||
sess.CtxMgr = s.ctxMgr
|
||||
sess.Actions = &chat.ActionServices{
|
||||
DocGov: s.gov,
|
||||
TaskRuns: s.taskRuns,
|
||||
}
|
||||
|
||||
// 若从持久层恢复了会话历史,回填消息列表、事实黑板与近期对话 (G3)。
|
||||
|
||||
Reference in New Issue
Block a user