返回顶部
c

chronos通用周期管理器

通用周期任务管理器 - 支持6种周期类型、每月N次配额、自动cron、统一视图,适用于所有定时任务场景

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.6.0
安全检测
已通过
247
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

chronos

Chronos - 通用周期任务管理器

该技能控制的内容

  • - 周期任务表:periodictasks + periodicoccurrences(默认使用共享 todo.db)
  • 原 todo 表:entries(仅兼容 legacy inbox / 未迁移旧任务)
  • 统一入口:todo.py

功能

周期类型

  • - once:一次性(有明确 --start-date 时走 canonical task/occurrence)
  • daily:每天
  • hourly:每 N 小时(--interval-hours + --time 作为锚点)
  • weekly:每周(指定星期几)
  • monthlyfixed:每月固定日期(如15号)
  • monthlyrange:每月区间(如11号→5号,跨月)
  • monthlyntimes:每月限次(如每周三每月最多2次,或 weekday 留空表示每天都可提醒,但本月完成满额后停止)
  • monthly_dates:每月多个固定日期(如 1,15,31)

智能配额

  • - 仅 completed 计数,skip 不计
  • monthlyntimes 若 weekday 为空,则按每日可提醒展开,但仍受每月配额约束
  • 配额用满后自动完成当月剩余活动日
  • 每月1号自动重置计数器

自动提醒

  • - Cron 任务自动生成(未来事件)
  • 每日自动清理过期 cron
  • 提醒投递必须显式指定目标 chat
  • 若时间已过,会走补发提醒分支
  • hourly 任务会在当天展开为多个 occurrence,按 scheduled_time 各自提醒/补完成

统一视图

  • - todo.py list:合并显示周期任务和普通任务
  • todo.py add:智能路由(scheduled recurring / scheduled once → canonical task;无日期的一次性便签 → entries)
  • todo.py complete:完成单个 occurrence 或普通任务
  • todo.py complete-overdue:优先基于 occurrence 补完成;legacy entries 仅保留兼容兜底
  • todo.py show:查看详情
  • todo.py skip:跳过任务且不消耗 monthlyntimes 配额

显式 system handler

  • - specialhandler 元数据挂在 periodictasks 上,不再只能靠 entries.text 正则猜测
  • 当前已支持:metareviewfallback、syncsubagentmemory
  • syncsubagentmemory 从 memory/subagentsyncledger.json 读取待同步 subagent session;现在应由 OpenClaw 在 subagent 完成路径自动写入 ledger,memorymanager.py record-subagent id> 仅保留给补录/回填场景,成功后标记 handled
  • overdue completion 会把 handler 结果写回 occurrence:completionmode / specialhandlerresult
  • 对同一天同一 hourly 任务的多个 overdue occurrence,如存在 specialhandler,complete-overdue 只执行一次 handler,再把所有相关 occurrence 标记为 fallbackhandlermerged,并写入 merged trace(merge_key / merged occurrence index/count)

配置

  • - Chat ID:提醒通知定向到特定 chat。通过以下方式配置:
- 环境变量:CHRONOSCHATID - 配置文件:~/.config/chronos/config.json(或 CHRONOSCONFIGPATH)中的 chat_id 字段 - 若两者均未设置,Chronos 会抛出配置错误
  • - 无隐式路由:Chronos 不会回退到 last 或任何隐式投递目标
  • 工作区/数据库覆盖
- CHRONOSDBPATH - CHRONOSWORKSPACE / OPENCLAWWORKSPACE - OPENCLAW_BIN

使用方法

bash

列出活跃待办(自动确保今天 occurrence 已生成)


python3 skills/chronos/scripts/todo.py list

如需连 skipped 一起看,显式打开

python3 skills/chronos/scripts/todo.py list --include-skipped

添加周期任务(例如:每月2次,每周三10:00)

python3 skills/chronos/scripts/todo.py add 周三抢券 \ --cycle-type monthlyntimes \ --weekday 2 \ --n-per-month 2 \ --time 10:00

添加每天都可提醒,但本月完成一次后本月不再提醒的任务

python3 skills/chronos/scripts/todo.py add 福建农行秒杀京东卡 \ --cycle-type monthlyntimes \ --n-per-month 1 \ --time 09:00

添加每4小时任务(08:00 作为锚点;当天展开为 00/04/08/12/16/20)

python3 skills/chronos/scripts/todo.py add 同步 subagent 记忆 \ --cycle-type hourly \ --interval-hours 4 \ --time 08:00 \ --task-kind system \ --special-handler syncsubagentmemory

添加一次性计划任务(Phase 1 起:有 start-date 就进入 canonical task)

python3 skills/chronos/scripts/todo.py add 周五 10 点抢券 \ --cycle-type once \ --start-date 2026-03-27 \ --time 10:00

添加每月多个日期任务

python3 skills/chronos/scripts/todo.py add 月初/中/末检查 \ --cycle-type monthly_dates \ --dates-list 1,15,31 \ --time 09:00

添加普通 inbox 便签(仍走 entries)

python3 skills/chronos/scripts/todo.py add 买牛奶 --category 生活

添加 system task(显式 handler)

python3 skills/chronos/scripts/todo.py add Meta-Review fallback \ --cycle-type daily \ --time 02:00 \ --task-kind system \ --special-handler metareviewfallback

完成任务

python3 skills/chronos/scripts/todo.py complete FIN-123 # 周期任务 occurrence python3 skills/chronos/scripts/todo.py complete 45 # legacy / inbox 任务 ID

统一补完成今天已经过时的计划任务

python3 skills/chronos/scripts/todo.py complete-overdue python3 skills/chronos/scripts/todo.py complete-overdue --dry-run

跳过任务(不影响配额)

python3 skills/chronos/scripts/todo.py skip FIN-123 # 周期任务 python3 skills/chronos/scripts/todo.py skip 45 # 普通任务

自然语言支持

python3 skills/chronos/scripts/todo.py 跳过 FIN-123 python3 skills/chronos/scripts/todo.py 查询待办 python3 skills/chronos/scripts/todo.py 添加任务 每4小时 08:00 同步subagent记忆

查看详情

python3 skills/chronos/scripts/todo.py show FIN-123

验证

bash
python3 -m unittest discover -s skills/chronos/tests -v
python3 skills/chronos/scripts/schema_preflight.py
python3 skills/chronos/scripts/test_config.py

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 chronos-1776061996 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 chronos-1776061996 技能

通过命令行安装

skillhub install chronos-1776061996

下载

⬇ 下载 chronos v1.6.0(免费)

文件大小: 88.5 KB | 发布时间: 2026-4-15 12:05

v1.6.0 最新 2026-4-15 12:05
Canonical scheduling cleanup, hourly/system task support, legacy archive handling, safer overdue completion, and improved reminder semantics.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部