Version: 0.8.6.dev.260401

后端:
新建了chat和execute节点,完善了相关逻辑,代码尚未review
前端:
无
仓库:
无
This commit is contained in:
LoveLosita
2026-04-01 21:35:41 +08:00
parent e1a06be768
commit 2c64b37d00
8 changed files with 817 additions and 50 deletions

View File

@@ -119,7 +119,20 @@ func RunPlanNode(ctx context.Context, input PlanNodeInput) error {
writePlanPinnedBlocks(conversationContext, decision.PlanSteps)
return nil
default:
return fmt.Errorf("未支持的规划动作: %s", decision.Action)
// 1. LLM 输出了不支持的 action不应直接报错终止而应给它修正机会。
// 2. 使用通用修正函数追加错误反馈,让 Graph 继续循环。
// 3. LLM 下一轮会看到错误反馈并修正自己的输出。
llmOutput := decision.Speak
if strings.TrimSpace(llmOutput) == "" {
llmOutput = decision.Reason
}
AppendLLMCorrectionWithHint(
conversationContext,
llmOutput,
fmt.Sprintf("你输出的 action \"%s\" 不是合法的执行动作。", decision.Action),
"合法的 action 包括continue继续当前步骤、ask_user追问用户、next_plan推进到下一步、done任务完成。",
)
return nil
}
}