Version: 0.7.1.dev.260320

🧠 agent智能编排:删除了落库相关逻辑。再次重申:agent智能编排旨在为用户预览排程结果,实际的落库由用户决定,并通过按钮触发常规接口进行落库。目前仅保留 ReAct 精排循环链路(待改进)。
📄 修改了 ReAct 智能精排决策文档相关内容。
🔄 undo:当前 agent 智能排程逻辑待改进。
This commit is contained in:
LoveLosita
2026-03-20 19:40:11 +08:00
parent d3cec2a5b9
commit 059b25872a
12 changed files with 115 additions and 661 deletions

View File

@@ -44,7 +44,7 @@ type SchedulePlanState struct {
// CandidatePlans 是粗排算法生成的候选方案(展示型结构,供 SSE 推送给前端预览)。
CandidatePlans []model.UserWeekSchedule
// AllocatedItems 是粗排算法已分配的任务项EmbeddedTime 已回填),供 materialize 直接转换
// AllocatedItems 是粗排算法已分配的任务项EmbeddedTime 已回填),供 ReAct 精排使用
AllocatedItems []model.TaskClassItem
// ── ReAct 精排阶段 ──
@@ -61,27 +61,6 @@ type SchedulePlanState struct {
// ReactDone 标记 ReAct 是否已完成。
ReactDone bool
// ── materialize 节点输出 ──
// ApplyRequest 是转换后的落库请求体。
ApplyRequest *model.UserInsertTaskClassItemToScheduleRequestBatch
// ── apply 节点输出 ──
// Applied 标记是否落库成功。
Applied bool
// ApplyError 记录落库失败的错误信息,供 reflect 节点分析。
ApplyError string
// ── reflect 节点状态 ──
// RetryCount 记录当前重试次数。
RetryCount int
// MaxRetry 是最大重试次数(建议 = 2
MaxRetry int
// ReflectAction 记录模型给出的修补动作retry_with_patch / partial_apply / give_up
ReflectAction string
// ── 连续对话微调 ──
// PreviousPlanJSON 是上一版已落库方案的 JSON 序列化,用于增量微调。
@@ -107,23 +86,11 @@ func NewSchedulePlanState(traceID string, userID int, conversationID string) *Sc
ConversationID: conversationID,
RequestNow: now,
RequestNowText: now.In(schedulePlanLocation()).Format(schedulePlanDatetimeLayout),
MaxRetry: 2,
Strategy: "steady",
ReactMaxRound: 3,
}
}
// CanRetry 判断当前是否还能继续重试落库。
func (s *SchedulePlanState) CanRetry() bool {
return s.RetryCount < s.MaxRetry
}
// RecordApplyError 记录一次落库失败。
func (s *SchedulePlanState) RecordApplyError(errMsg string) {
s.RetryCount++
s.ApplyError = errMsg
}
// schedulePlanLocation 返回排程链路使用的业务时区。
func schedulePlanLocation() *time.Location {
loc, err := time.LoadLocation(schedulePlanTimezoneName)