Version: 0.9.34.dev.260421
后端: 1. 旧 Agent 管线(agent/)全面下线,共享逻辑迁移至 newAgent/ - 删除 backend/agent/ 整个目录(44 个 Go 文件),5 条旧专用流程已由 newAgent 统一 graph 取代 - 共享逻辑迁入 newAgent/:clone(shared/clone.go)、时间解析(shared/deadline.go)、优先级常量(shared/task_priority.go)、TaskQuery 类型(model/taskquery_types.go)、SystemPrompt(prompt/system.go)、Usage 合并(stream/usage.go) 2. service 层清除 agent/ 全部依赖 - 删除 4 个旧流程入口文件(agent_route / agent_quick_note / agent_schedule_plan / agent_schedule_refine) - agent_task_query.go 删除 runTaskQueryFlow,参数类型切到 newagentmodel - agent.go / agent_newagent.go / agent_schedule_preview.go / agent_schedule_state.go / cmd/start.go / quicknote.go:agent* 引用全部替换为 newagent* 3. 流式降级回退路径内联到 service 层(agent_stream_fallback.go),消除最后一条 agent/chat 依赖 前端: 1. ScheduleFineTuneModal 幂等键追加 classId 后缀,修复多任务类并行保存 key 重复
This commit is contained in:
@@ -6,8 +6,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
agentmodel "github.com/LoveLosita/smartflow/backend/agent/model"
|
||||
agentnode "github.com/LoveLosita/smartflow/backend/agent/node"
|
||||
newagentshared "github.com/LoveLosita/smartflow/backend/newAgent/shared"
|
||||
"github.com/LoveLosita/smartflow/backend/newAgent/tools/schedule"
|
||||
)
|
||||
|
||||
@@ -40,11 +39,11 @@ type QuickNoteCreateResult struct {
|
||||
func quickNoteFallbackPriority(deadline *time.Time) int {
|
||||
if deadline != nil {
|
||||
if time.Until(*deadline) <= 48*time.Hour {
|
||||
return agentmodel.QuickNotePriorityImportantUrgent
|
||||
return newagentshared.QuickNotePriorityImportantUrgent
|
||||
}
|
||||
return agentmodel.QuickNotePriorityImportantNotUrgent
|
||||
return newagentshared.QuickNotePriorityImportantNotUrgent
|
||||
}
|
||||
return agentmodel.QuickNotePrioritySimpleNotImportant
|
||||
return newagentshared.QuickNotePrioritySimpleNotImportant
|
||||
}
|
||||
|
||||
// NewQuickNoteToolHandler 创建 quick_note_create 工具的 handler 闭包。
|
||||
@@ -81,7 +80,7 @@ func NewQuickNoteToolHandler(deps QuickNoteDeps) ToolHandler {
|
||||
raw = strings.TrimSpace(raw)
|
||||
if raw != "" {
|
||||
// 调用目的:复用旧链路成熟的中文相对时间解析器,支持"明天下午3点"等格式。
|
||||
parsed, err := agentnode.ParseOptionalDeadline(raw)
|
||||
parsed, err := newagentshared.ParseOptionalDeadline(raw)
|
||||
if err != nil {
|
||||
return fmt.Sprintf("工具调用失败:截止时间格式无法解析(%s)。支持格式:2026-04-20 18:00、明天下午3点、下周一上午9点。", err)
|
||||
}
|
||||
@@ -94,7 +93,7 @@ func NewQuickNoteToolHandler(deps QuickNoteDeps) ToolHandler {
|
||||
if pg, ok := args["priority_group"].(float64); ok {
|
||||
priorityGroup = int(pg)
|
||||
}
|
||||
if !agentmodel.IsValidTaskPriority(priorityGroup) {
|
||||
if !newagentshared.IsValidTaskPriority(priorityGroup) {
|
||||
priorityGroup = quickNoteFallbackPriority(deadline)
|
||||
}
|
||||
|
||||
@@ -108,10 +107,10 @@ func NewQuickNoteToolHandler(deps QuickNoteDeps) ToolHandler {
|
||||
}
|
||||
|
||||
// 6. 组装结构化返回,包含 banter 提示引导 LLM 自然生成调侃。
|
||||
priorityLabel := agentmodel.PriorityLabelCN(priorityGroup)
|
||||
priorityLabel := newagentshared.PriorityLabelCN(priorityGroup)
|
||||
deadlineStr := ""
|
||||
if deadline != nil {
|
||||
deadlineStr = deadline.In(agentnode.QuickNoteLocation()).Format("2006-01-02 15:04")
|
||||
deadlineStr = deadline.In(newagentshared.ShanghaiLocation()).Format("2006-01-02 15:04")
|
||||
}
|
||||
|
||||
result := QuickNoteCreateResult{
|
||||
|
||||
Reference in New Issue
Block a user