Files
GenericAgent/memory/scheduled_task_sop.md
2026-03-11 12:11:22 +08:00

21 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 定时任务 SOP
目录:`../sche_tasks/` 放任务定义JSON`../sche_tasks/done/` 放执行报告
## 任务JSON格式*.json
```json
{"schedule":"08:00", "repeat":"daily", "enabled":true, "prompt":"..."}
```
repeat可选daily | weekly | monthly | once | every_Nh每N小时| every_Nd每N天
## 触发流程
1. scheduler.pyreflect/每60秒轮询 sche_tasks/*.json
2. 条件全满足才触发enabled=true + 当前时间≥schedule + 冷却时间已过基于done/最新报告时间戳)
3. 触发时拼prompt含报告路径 `../sche_tasks/done/YYYY-MM-DD_任务名.md`
4. **收到任务后第一件事**:用 update_working_checkpoint 记录报告目标文件路径,防止长任务执行中遗忘
5. 执行完毕后将报告写入上述路径scheduler靠此文件判断今天已执行
## 注意
- once类型执行一次后冷却100年实际效果为永久跳过
- 任务文件只管"干什么"报告路径由scheduler自动生成注入prompt
- sche_tasks目录在../即code root下