48 lines
2.2 KiB
JSON
48 lines
2.2 KiB
JSON
{
|
|
"module": "todo_executor",
|
|
"version": "1.0",
|
|
"purpose": "TODO 自修复执行器(每10分钟)。轮询 health_todos.jsonl 中 status=pending 的条目,执行 fix_script 重启异常服务。成功标记 completed,失败 escalation 到 XMPP 群聊。",
|
|
"ui_location": "F Tab → 定时任务 → TODO自修复",
|
|
|
|
"human_help": {
|
|
"title": "TODO 自修复执行器",
|
|
"description": [
|
|
"每 10 分钟由 Windows Task Scheduler 触发,自动修复健康检查发现的异常。",
|
|
"读取 health_todos.jsonl 中的 pending 条目,执行对应的 fix_script。",
|
|
"修复成功 → 标记 completed。",
|
|
"修复失败 → 通过 XMPP HTTP 桥(:5802/send)发送告警到群聊。",
|
|
"特殊情况:如果错误信息为 'another instance is already running',说明服务已在正常运行,标记 completed 跳过。"
|
|
],
|
|
"usage": [
|
|
"TODO 文件:gateway/temp/health_todos.jsonl(输入+输出)",
|
|
"日志:gateway/logs/todo_executor.log",
|
|
"告警通道:HTTP POST → 127.0.0.1:5802/send → XMPP 群聊"
|
|
],
|
|
"troubleshooting": [
|
|
"如果 TODO 堆积不减少:检查 agents-todo-executor 定时任务是否运行",
|
|
"如果修复失败:检查 fix_script 路径是否存在(远程服务的 fix_script 为 null,无法自动修复)",
|
|
"如果告警未发出:检查 xmpp_bot HTTP 桥 :5802/send 是否可达"
|
|
],
|
|
"related": "消费 agents_health_check.py 的 TODO 输出; 通过 xmpp_bot HTTP 桥发送告警"
|
|
},
|
|
|
|
"ai_spec": {
|
|
"dependencies": [
|
|
"health_todos.jsonl — TODO 输入(由 agents_health_check.py 写入)",
|
|
"xmpp_bot HTTP 桥 (:5802/send) — 告警输出通道",
|
|
"Python 3.10",
|
|
"Windows Task Scheduler — 每10分钟触发"
|
|
],
|
|
"constraints": [
|
|
"只修复有 fix_script 的服务(远程服务无本地脚本,无法自动修复)",
|
|
"already_running 错误视为成功(服务已在运行)",
|
|
"单次执行超时 30s — 大脚本可能被截断"
|
|
],
|
|
"related_files": [
|
|
"gateway/scripts/self_todo_executor.py — 本脚本",
|
|
"gateway/scripts/agents_health_check.py — TODO 生产者",
|
|
"gateway/scripts/specs/todo_executor.json — 本 spec"
|
|
]
|
|
}
|
|
}
|