Skip to content

Fix cron sync bugs and clarify hook docs#9

Merged
maxdraki merged 1 commit into
mainfrom
fix/openclaw-cron-sync
Mar 12, 2026
Merged

Fix cron sync bugs and clarify hook docs#9
maxdraki merged 1 commit into
mainfrom
fix/openclaw-cron-sync

Conversation

@maxdraki
Copy link
Copy Markdown
Owner

Summary

  • Fix 5 bugs in sync.py found during real-world deployment against OpenClaw v2026.3.x:
    • cron runs requires --id flag (not positional arg)
    • cron runs does not support --json — added json_flag parameter
    • cron list wraps output in {"jobs": [...]} — added automatic unwrapping
    • Config version warnings on stdout break JSON parsing — now scans for first { or [
    • Run timestamps are epoch milliseconds, not ISO strings — fixed comparison logic
  • Clarify hook docs: HOOK.md now documents both handlers (handler.ts = active, index.ts = future)
  • Add compatibility note to index.ts — the events it expects (conversation:start/end, model:used) are not yet emitted by OpenClaw
  • Add Docker deployment docs to cron sync README

Test plan

  • Tested sync.py against live OpenClaw instance (19 jobs, 11 runs synced)
  • Verified handler.ts produces traces in AgentWatch dashboard
  • Confirm docs render correctly on GitHub

🤖 Generated with Claude Code

Five bugs fixed in sync.py discovered during real-world testing:
- `cron runs` requires `--id` flag, not positional arg
- `cron runs` does not support `--json` (added json_flag parameter)
- `cron list` wraps output in `{"jobs": [...]}` — added unwrapping
- Config version warnings on stdout break JSON parsing — scan for first { or [
- Run timestamps are epoch ms, not ISO strings — fixed comparison

Also documents that index.ts expects events (conversation:start/end,
model:used) not yet emitted by OpenClaw v2026.3.x, and clarifies which
handler to use in HOOK.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maxdraki maxdraki merged commit 1cff175 into main Mar 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants