Version: 0.9.4.dev.260407

后端:
1.粗排结果/预览语义修复(task_item suggested 保真 + existing/嵌入识别补全)
- 更新conv/schedule_state.go:LoadScheduleState 补齐 event.rel_id / schedules.embedded_task_id / task_item.embedded_time 三种“已落位”信号;嵌入任务强制 existing + 继承 host slots;补充 task_item duration/name/slot helper;Diff 相关英文注释改中文
- 更新conv/schedule_preview.go:预览层新增 shouldMarkSuggestedInPreview,pending 任务与 source=task_item 的建议态任务统一输出 suggested
2.newAgent 状态快照增强(ScheduleState/OriginalScheduleState 跨轮恢复)
- 更新model/state_store.go:AgentStateSnapshot 新增 ScheduleState / OriginalScheduleState
- 更新model/graph_run_state.go:AgentGraphRunInput/AgentGraphState 接入两份 schedule 状态;恢复旧快照时自动补 original clone
- 更新service/agentsvc/agent_newagent.go:loadOrCreateRuntimeState 返回并恢复 schedule/original;runNewAgentGraph 透传到 graph
- 更新node/agent_nodes.go:saveAgentState 一并保存 schedule/original 到 Redis 快照 3.Execute 链路纠偏(只写内存不落库 + 完整打点 + 恢复消息去重)
- 更新node/execute.go:AlwaysExecute/confirm resume 路径取消 PersistScheduleChanges,仅保留内存写;新增 execute LLM 完整上下文日志;新增工具调用前后 state 摘要日志;thinking 模式改为 enabled
- 更新node/chat.go:pending resume 不再重复写入同一轮 user message
- 更新service/agentsvc/agent_newagent.go:新增 deliver preview write/state 摘要日志,便于排查 suggested 丢失问题
4.AlwaysExecute 贯通 Plan→Graph→Execute
- 更新node/plan.go:PlanNodeInput 新增 AlwaysExecute;plan_done 后支持自动确认直接进入执行
- 更新graph/common_graph.go:branchAfterPlan 支持 PhaseExecuting/PhaseDone 分支
5.排课上下文补强(显式注入 task_class_ids,减少 Execute 误 ask_user)
- 更新prompt/execute.go:Plan/ReAct 两种 execute prompt 都显式写入任务类 ID,声明“上下文已完整,无需追问”
- 更新node/rough_build.go:粗排完成 pinned block 显式标注任务类 ID,避免 Execute 找不到 ID 来源
6.流式输出与预览调试工具修复
- 更新stream/emitter.go:保留换行,修复 pseudo stream 分片后文本黏连/双换行问题
- 更新infra/schedule_preview_viewer.html:升级预览工具,支持 candidate_plans / hybrid_entries

前端:无
仓库:
1.更新了infra内的html,适应了获取日程接口
This commit is contained in:
LoveLosita
2026-04-07 21:13:59 +08:00
parent 32bb740b75
commit 07d307fe07
15 changed files with 1378 additions and 400 deletions

View File

@@ -147,10 +147,12 @@ func (d *AgentGraphDeps) ResolveDeliverClient() *newagentllm.Client {
// 3. Request当前这次请求的轻量输入
// 4. Depsgraph/node 层真正依赖的可插拔能力。
type AgentGraphRunInput struct {
RuntimeState *AgentRuntimeState
ConversationContext *ConversationContext
Request AgentGraphRequest
Deps AgentGraphDeps
RuntimeState *AgentRuntimeState
ConversationContext *ConversationContext
ScheduleState *newagenttools.ScheduleState
OriginalScheduleState *newagenttools.ScheduleState
Request AgentGraphRequest
Deps AgentGraphDeps
}
// AgentGraphState 是 graph 内部真正流转的运行态容器。
@@ -171,10 +173,12 @@ type AgentGraphState struct {
// NewAgentGraphState 把入口参数整理成 graph 内部状态。
func NewAgentGraphState(input AgentGraphRunInput) *AgentGraphState {
st := &AgentGraphState{
RuntimeState: input.RuntimeState,
ConversationContext: input.ConversationContext,
Request: input.Request,
Deps: input.Deps,
RuntimeState: input.RuntimeState,
ConversationContext: input.ConversationContext,
Request: input.Request,
Deps: input.Deps,
ScheduleState: input.ScheduleState,
OriginalScheduleState: input.OriginalScheduleState,
}
st.Request.Normalize()
st.EnsureRuntimeState()
@@ -238,6 +242,12 @@ func (s *AgentGraphState) EnsureScheduleState(ctx context.Context) (*newagenttoo
return nil, nil
}
if s.ScheduleState != nil {
if s.OriginalScheduleState == nil {
// 1. 兼容老快照:历史 Redis 快照里可能还没带 original_state。
// 2. 当前阶段虽然已经不落库,但后续若重新接回 diff 链,仍需要稳定的原始快照。
// 3. 因此这里在“已恢复出 ScheduleState、但缺 original”时补一份克隆兜底。
s.OriginalScheduleState = s.ScheduleState.Clone()
}
return s.ScheduleState, nil
}
if s.Deps.ScheduleProvider == nil {

View File

@@ -14,8 +14,10 @@ import (
// 3. 不保存 Deps依赖注入每次由 Service 层重建);
// 4. 不保存 ToolSchemas每次请求由 Service 层重新注入)。
type AgentStateSnapshot struct {
RuntimeState *AgentRuntimeState `json:"runtime_state"`
ConversationContext *ConversationContext `json:"conversation_context"`
RuntimeState *AgentRuntimeState `json:"runtime_state"`
ConversationContext *ConversationContext `json:"conversation_context"`
ScheduleState *newagenttools.ScheduleState `json:"schedule_state,omitempty"`
OriginalScheduleState *newagenttools.ScheduleState `json:"original_schedule_state,omitempty"`
}
// AgentStateStore 定义 agent 状态持久化的最小接口。