zeph-scheduler
Cron-based periodic task scheduler with SQLite persistence for Zeph.
Overview
Runs recurring tasks on cron schedules, persisting job state and last-run timestamps in SQLite. Ships with built-in tasks for memory cleanup, skill refresh, health checks, and automatic update detection. Feature-gated behind scheduler.
Key Modules
- scheduler —
Schedulerevent loop managing job evaluation and dispatch - store —
JobStorefor SQLite-backed job persistence - task —
ScheduledTask,TaskHandler,TaskKinddefining task types and execution - update_check —
UpdateCheckHandlerfor GitHub releases version check - error —
SchedulerErrorerror types
Built-in Tasks
| Kind | String key | Description |
|---|---|---|
TaskKind::MemoryCleanup |
memory_cleanup |
Prune expired memory entries |
TaskKind::SkillRefresh |
skill_refresh |
Hot-reload changed skill files |
TaskKind::HealthCheck |
health_check |
Periodic self-diagnostics |
TaskKind::UpdateCheck |
update_check |
Check GitHub releases for a newer version |
UpdateCheckHandler
UpdateCheckHandler implements TaskHandler and queries the GitHub releases API to compare the running version against the latest published release. When a newer version is detected it sends a human-readable notification over an mpsc::Sender<String> channel.
use mpsc;
use ;
let = channel;
let handler = new;
let task = new?;
scheduler.add_task;
scheduler.register_handler;
Notification format sent via the channel:
New version available: v0.12.0 (current: v0.11.5).
Update: https://github.com/bug-ops/zeph/releases/tag/v0.12.0
Behaviour on error (network failure, non-2xx response, oversized body, parse error, invalid semver) — logs a warn message and returns Ok(()). The check is best-effort and never crashes the agent.
Installation
Enabled via the scheduler feature flag on the root zeph crate.
License
MIT