Version: 0.9.41.dev.260424
后端: 1. 随口记从 Execute 工具链路迁移到独立 QuickTask 轻量节点——单轮流式提取意图直接调 service,绕过 ReAct 循环 - 新增 QuickTask graph 节点 + Chat→QuickTask→END 分支 - Chat 路由提示词新增 quick_task 路由判别规则,execute 路由收窄为日程类 - Execute 提示词(有 plan / ReAct 两套)移除 quick_note_create / query_tasks 指令 - ToolRegistry 注销 quick_note_create / query_tasks,移除相关依赖与注册 - 依赖注入从 ToolRegistry 改为 Service 层直接注入 QuickTaskDeps 2. urgency_threshold_at 代码兜底 + API 返回补全 - priorityGroup=2 且有 deadline 但 LLM 未填时,自动设为 deadline-24h - 任务查询接口返回结构补充 UrgencyThresholdAt 字段与转换映射 3. 记忆召回条数 5→10
This commit is contained in:
@@ -20,6 +20,7 @@ const (
|
||||
NodeOrderGuard = "order_guard"
|
||||
NodeInterrupt = "interrupt"
|
||||
NodeDeliver = "deliver"
|
||||
NodeQuickTask = "quick_task"
|
||||
)
|
||||
|
||||
func RunAgentGraph(ctx context.Context, input newagentmodel.AgentGraphRunInput) (*newagentmodel.AgentGraphState, error) {
|
||||
@@ -55,6 +56,9 @@ func RunAgentGraph(ctx context.Context, input newagentmodel.AgentGraphRunInput)
|
||||
if err := g.AddLambdaNode(NodeOrderGuard, compose.InvokableLambda(nodes.OrderGuard)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := g.AddLambdaNode(NodeQuickTask, compose.InvokableLambda(nodes.QuickTask)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := g.AddLambdaNode(NodeInterrupt, compose.InvokableLambda(nodes.Interrupt)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -68,7 +72,7 @@ func RunAgentGraph(ctx context.Context, input newagentmodel.AgentGraphRunInput)
|
||||
if err := g.AddEdge(compose.START, NodeChat); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Chat -> END / Plan / Confirm / RoughBuild / Execute / Deliver / Interrupt
|
||||
// Chat -> END / Plan / Confirm / RoughBuild / Execute / QuickTask / Deliver / Interrupt
|
||||
if err := g.AddBranch(NodeChat, compose.NewGraphBranch(
|
||||
branchAfterChat,
|
||||
map[string]bool{
|
||||
@@ -76,6 +80,7 @@ func RunAgentGraph(ctx context.Context, input newagentmodel.AgentGraphRunInput)
|
||||
NodeConfirm: true,
|
||||
NodeRoughBuild: true,
|
||||
NodeExecute: true,
|
||||
NodeQuickTask: true,
|
||||
NodeDeliver: true,
|
||||
NodeInterrupt: true,
|
||||
compose.END: true,
|
||||
@@ -150,6 +155,10 @@ func RunAgentGraph(ctx context.Context, input newagentmodel.AgentGraphRunInput)
|
||||
if err := g.AddEdge(NodeDeliver, compose.END); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// QuickTask -> END:轻量路径,直接返回结果。
|
||||
if err := g.AddEdge(NodeQuickTask, compose.END); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// --- 编译运行 ---
|
||||
maxSteps := flowState.MaxRounds + 10
|
||||
@@ -186,6 +195,8 @@ func branchAfterChat(_ context.Context, st *newagentmodel.AgentGraphState) (stri
|
||||
return NodePlan, nil
|
||||
case newagentmodel.PhaseWaitingConfirm:
|
||||
return NodeConfirm, nil
|
||||
case newagentmodel.PhaseQuickTask:
|
||||
return NodeQuickTask, nil
|
||||
case newagentmodel.PhaseExecuting:
|
||||
if flowState.NeedsRoughBuild && st.Deps.RoughBuildFunc != nil {
|
||||
return NodeRoughBuild, nil
|
||||
|
||||
Reference in New Issue
Block a user