Skip to content

Feature:Add Scheduled tasks - #73

Open
mengnankkkk wants to merge 2 commits into
mainfrom
feature/add_task
Open

Feature:Add Scheduled tasks#73
mengnankkkk wants to merge 2 commits into
mainfrom
feature/add_task

Conversation

@mengnankkkk

Copy link
Copy Markdown
Member

No description provided.

- 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
@lzq986

lzq986 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

大的PR,加一下设计思路以作记录
顺带加个issue关联

@lzq986
lzq986 requested a review from VLSMB August 5, 2026 14:13
@RequiredArgsConstructor
public class ScheduledAgentTaskRunner {

private static final Duration LOCK_DURATION = Duration.ofMinutes(30);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent 任务一旦跑超过 30 分钟,锁过期,下一个 tick 另一个实例就抢走锁 → 同一任务并发执行两次,对一个会执行 SQL、生成报告的 Agent 来说就是副作用重复。
把常量改成配置项,部署者按自己最坏任务时长调

}

private String buildPrompt(ScheduledAgentTask task) {
return task.getPrompt() + "\n\n定时任务执行要求:如果信息不足或需要用户确认,请直接说明无法完成,不要调用 ask_user 反问用户。";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prompt无法限制的。看看是否改造ask_user工具,加个配置项,如果是定时任务调了这个就不要抛出异常,因为目前抛出异常是为了框架能进行人工接入。
或者看看有无别的更好的办法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants