Feature:Add Scheduled tasks - #73
Open
mengnankkkk wants to merge 15 commits into
Open
Conversation
- add scheduled task CRUD, dispatch, run history, and owner-based run locking - validate schedule expressions, positive intervals, and timezone-aware next runs - add scheduled task management frontend page - append scheduled task tables to data_source.sql
Contributor
|
大的PR,加一下设计思路以作记录 |
lzq986
reviewed
Aug 5, 2026
Member
|
如果 |
VLSMB
reviewed
Aug 8, 2026
- collapse AgentService chat stream overloads into ToolCallContext - move TaskType out of ToolCallContext and restore context builder - move scheduled task persistence logic out of controller - add scheduled task response DTO and scheduler service operations - split scheduled task execution from mapper-backed scheduling service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
任务调度用数据库锁做轻量分布式协调:多个实例轮询时,只有抢到 lock_owner + lock_until 的实例能执行。
锁不是永久锁,任务失败或实例异常后可以靠 lock_until 自动释放。
锁时长交给部署配置,避免长任务超过固定 30 分钟后被其他实例重复执行 SQL/生成报告。
普通聊天保留 ask_user 挂起能力;定时任务关闭人工追问能力,让 Agent 自己判断无法完成并结束。
强约束放在工具层,prompt 只作为行为提示,不作为可靠控制边界。
主要修改
新增了定时任务的后端 CRUD、实体、Mapper、调度器、下次执行时间计算逻辑,以及前端定时任务管理页。调度器负责轮询到期任务、抢锁、异步执行、完成后计算下一次运行时间。AgentService 和 AskUserTool 增加了 allowUserPrompt 执行上下文,用来区分普通会话和定时任务。
#36