Version: 0.8.7.dev.260402
后端: 1.Plan节点实现两阶段LLM调用:Phase1无thinking快速评估复杂度,复杂任务自动开启Phase2深度规划 2.Execute节点新增GoalCheck自省机制:LLM输出next_plan/done时必须附带对照done_when的完成验证,为空则追加修正重试 前端:无 仓库:无
This commit is contained in:
@@ -131,6 +131,20 @@ func RunExecuteNode(ctx context.Context, input ExecuteNodeInput) error {
|
||||
return fmt.Errorf("执行决策不合法: %w", err)
|
||||
}
|
||||
|
||||
// 自省校验:next_plan / done 必须附带 goal_check,否则不推进,追加修正让 LLM 重试。
|
||||
if decision.Action == newagentmodel.ExecuteActionNextPlan ||
|
||||
decision.Action == newagentmodel.ExecuteActionDone {
|
||||
if strings.TrimSpace(decision.GoalCheck) == "" {
|
||||
AppendLLMCorrectionWithHint(
|
||||
conversationContext,
|
||||
decision.Speak,
|
||||
fmt.Sprintf("你输出了 action=%s,但 goal_check 为空。", decision.Action),
|
||||
fmt.Sprintf("输出 %s 时,必须在 goal_check 中对照 done_when 逐条说明完成依据。", decision.Action),
|
||||
)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// 6. 若 LLM 先对用户说话,则伪流式推送并写回历史。
|
||||
if strings.TrimSpace(decision.Speak) != "" {
|
||||
if err := emitter.EmitPseudoAssistantText(
|
||||
|
||||
Reference in New Issue
Block a user