Version: 0.9.35.dev.260422
后端: 1. 任务查询统一紧急性提升链路——LLM 工具与前端共享读时派生 + outbox 异步落库 - service/task.go:GetUserTasks 中读时提升逻辑抽取为独立方法 GetTasksWithUrgencyPromotion,返回 []model.Task 供两路复用 - service/agentsvc/agent.go:新增 GetTasksWithUrgencyPromotionFunc 函数注入字段 - service/agentsvc/agent_task_query.go:QueryTasksForTool 优先走统一提升链路,未注入时回退旧 taskRepo 直接读取 - service/agent_bridge.go:NewAgentServiceWithSchedule 接收 TaskService 并注入提升函数 - cmd/start.go:启动接线传入 taskSv 2. 移除未使用依赖 - go.mod:删除 github.com/bytedance/mockey
This commit is contained in:
@@ -50,6 +50,12 @@ type AgentService struct {
|
||||
// 2. 该函数只做”窗口解析”,不负责粗排与混排计算。
|
||||
ResolvePlanningWindowFunc func(ctx context.Context, userID int, taskClassIDs []int) (startWeek, startDay, endWeek, endDay int, err error)
|
||||
|
||||
// ── 任务紧急性提升依赖(函数注入,避免 service 包循环依赖)──
|
||||
|
||||
// GetTasksWithUrgencyPromotionFunc 读取用户任务并应用读时紧急性提升 + 异步落库触发。
|
||||
// 未注入时,QueryTasksForTool 回退到旧逻辑(纯内存提升,不持久化)。
|
||||
GetTasksWithUrgencyPromotionFunc func(ctx context.Context, userID int) ([]model.Task, error)
|
||||
|
||||
// ── newAgent 依赖(由 cmd/start.go 通过 Set* 方法注入)──
|
||||
toolRegistry *newagenttools.ToolRegistry
|
||||
scheduleProvider newagentmodel.ScheduleStateProvider
|
||||
|
||||
Reference in New Issue
Block a user