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:
Losita
2026-04-02 22:56:06 +08:00
parent 2c64b37d00
commit 64b946816f
6 changed files with 136 additions and 41 deletions

View File

@@ -38,10 +38,11 @@ const (
// 3. Reason 是给后端和日志看的简短解释,不直接等价于完成证明;
// 4. ToolCall 只是“意图”,不代表工具已经真正执行成功。
type ExecuteDecision struct {
Speak string `json:"speak,omitempty"`
Action ExecuteAction `json:"action"`
Reason string `json:"reason,omitempty"`
ToolCall *ToolCallIntent `json:"tool_call,omitempty"`
Speak string `json:"speak,omitempty"`
Action ExecuteAction `json:"action"`
Reason string `json:"reason,omitempty"`
GoalCheck string `json:"goal_check,omitempty"`
ToolCall *ToolCallIntent `json:"tool_call,omitempty"`
}
// Normalize 统一清洗 execute 决策中的字符串字段。
@@ -52,6 +53,7 @@ func (d *ExecuteDecision) Normalize() {
d.Speak = strings.TrimSpace(d.Speak)
d.Action = ExecuteAction(strings.TrimSpace(string(d.Action)))
d.Reason = strings.TrimSpace(d.Reason)
d.GoalCheck = strings.TrimSpace(d.GoalCheck)
if d.ToolCall != nil {
d.ToolCall.Normalize()
}