Repository navigation
Task scheduler and heartbeat for autonomous operation - #2
Merged
Merged
Conversation
Completes the schedule_task MCP loop and adds openclaw-style heartbeat: - src/cron.js: zero-dep 5-field cron parser (lists, ranges, steps, named months/days, dom/dow OR semantics, leap-year aware) - src/task-store.js: JSON file-backed task persistence with atomic writes; writes current_tasks.json snapshots into group folders so the list_tasks MCP tool works inside containers; createTaskIpcHandler wires schedule/pause/resume/cancel_task IPC into the store with main-vs-group authorization - src/task-scheduler.js: polls due tasks, runs them concurrently without double-firing, reschedules (cron/interval) or completes (once) - src/heartbeat.js: periodic wake reading HEARTBEAT.md per group, HEARTBEAT_OK suppression, quiet hours (midnight-crossing), triggerNow Config: schedulerPollInterval (60s), heartbeatInterval (30min) + JSCLAW_SCHEDULER_POLL_INTERVAL / JSCLAW_HEARTBEAT_INTERVAL env vars. Bumps version to 0.0.2. Closes #1
This was referenced Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1
What
Phase 1 of openclaw parity — completes the half-built
schedule_taskloop and adds the heartbeat that turns jsclaw agents from reactive into autonomous. All zero-dependency, pure JS ESM.New modules
src/cron.jssrc/task-store.jscurrent_tasks.jsonsnapshots (makes thelist_tasksMCP tool work);createTaskIpcHandlerwires the four task MCP tools into the store with main-vs-group authorizationsrc/task-scheduler.jssrc/heartbeat.jsHEARTBEAT.mdtasks;HEARTBEAT_OKreplies suppressed; quiet hours (handles midnight crossing);triggerNow()Verified
Version bumped to 0.0.2.