openclaw-scheduler 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +302 -0
- package/BEST-PRACTICES.md +506 -0
- package/CHANGELOG.md +82 -0
- package/CODE_OF_CONDUCT.md +22 -0
- package/CONTEXT.md +26 -0
- package/CONTRIBUTING.md +73 -0
- package/IMPLEMENTATION_SPEC.md +170 -0
- package/INSTALL-ADDITIONAL-HOST.md +333 -0
- package/INSTALL-LINUX.md +419 -0
- package/INSTALL-WINDOWS.md +305 -0
- package/INSTALL.md +364 -0
- package/JOB-QUICK-REF.md +222 -0
- package/LICENSE +21 -0
- package/QUICK-START.md +256 -0
- package/README.md +2170 -0
- package/SECURITY.md +34 -0
- package/UNINSTALL.md +129 -0
- package/UPGRADING.md +436 -0
- package/agents.js +67 -0
- package/approval.js +107 -0
- package/backup.js +390 -0
- package/bin/openclaw-scheduler.js +138 -0
- package/cli.js +1083 -0
- package/db.js +122 -0
- package/dispatch/529-recovery.mjs +204 -0
- package/dispatch/README.md +372 -0
- package/dispatch/config.example.json +24 -0
- package/dispatch/deliver-watcher.sh +57 -0
- package/dispatch/hooks.mjs +171 -0
- package/dispatch/index.mjs +1836 -0
- package/dispatch/watcher.mjs +1396 -0
- package/dispatch-queue.js +112 -0
- package/dispatcher-approvals.js +96 -0
- package/dispatcher-delivery.js +43 -0
- package/dispatcher-maintenance.js +242 -0
- package/dispatcher-shell.js +29 -0
- package/dispatcher-strategies.js +1280 -0
- package/dispatcher-utils.js +81 -0
- package/dispatcher.js +855 -0
- package/docs/adr-schedule-ownership.md +73 -0
- package/docs/gateway-contract.md +904 -0
- package/docs/plans/2026-03-09-fix-typescript-types.md +91 -0
- package/docs/plans/2026-03-09-test-coverage-gaps.md +83 -0
- package/docs/plans/2026-03-10-dispatcher-refactor.md +801 -0
- package/docs/trust-architecture.md +266 -0
- package/gateway.js +473 -0
- package/idempotency.js +119 -0
- package/index.d.ts +864 -0
- package/index.js +17 -0
- package/jobs.js +1224 -0
- package/messages.js +357 -0
- package/migrate-consolidate.js +694 -0
- package/migrate.js +125 -0
- package/package.json +130 -0
- package/paths.js +79 -0
- package/prompt-context.js +94 -0
- package/retrieval.js +176 -0
- package/runs.js +270 -0
- package/scheduler-schema.js +101 -0
- package/schema.sql +480 -0
- package/scripts/dispatch-cli-utils.mjs +65 -0
- package/scripts/inbox-consumer.mjs +288 -0
- package/scripts/stuck-detector.sh +18 -0
- package/scripts/stuck-run-detector.mjs +333 -0
- package/scripts/telegram-webhook-check.mjs +238 -0
- package/setup.mjs +724 -0
- package/shell-result.js +214 -0
- package/task-tracker.js +300 -0
- package/team-adapter.js +335 -0
- package/v02-runtime.js +599 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# ADR: Schedule Ownership Between OpenClaw and openclaw-scheduler
|
|
2
|
+
|
|
3
|
+
Date: 2026-03-28
|
|
4
|
+
Status: Accepted
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
Three systems have scheduling-adjacent capabilities:
|
|
9
|
+
|
|
10
|
+
- OpenClaw provides native heartbeat and cron for personal assistant automation. These are product-level features built into the OpenClaw runtime for simple recurring prompts and periodic health signals.
|
|
11
|
+
- openclaw-scheduler provides durable orchestration with queueing, retries, approvals, chaining, audit, and recovery. It backs all of this with SQLite and supports mixed shell and agent workflows in the same chain.
|
|
12
|
+
- agentcli compiles manifest workflows toward openclaw-scheduler. It is the control plane for manifest authoring, validation, and compilation, but it does not execute prompt tasks locally and does not own a queue, retry engine, or approval state.
|
|
13
|
+
|
|
14
|
+
Without an explicit boundary, new work risks duplicating scheduling features across layers with slightly different semantics. OpenClaw's built-in cron might gain retry logic, agentcli might accumulate scheduling state, or openclaw-scheduler might start interpreting raw manifest schemas -- each case eroding the separation that keeps the three layers manageable.
|
|
15
|
+
|
|
16
|
+
## Decision
|
|
17
|
+
|
|
18
|
+
1. OpenClaw native cron/heartbeat is for product-level personal assistant automation. These jobs are non-durable: they have no retry, no approval gate, no chaining, and no guaranteed delivery. If the gateway is down when a cron job fires, the execution is silently skipped.
|
|
19
|
+
2. openclaw-scheduler is for manifest-native durable workflows that need queueing, retries, approvals, audit, chaining, and guaranteed delivery. It owns run history, failure recovery, overlap policies, and the full lifecycle of shell and agent jobs.
|
|
20
|
+
3. agentcli NEVER targets OpenClaw native cron directly. All recurring prompt tasks in agentcli manifests compile toward openclaw-scheduler via `compileManifestToScheduler`. The `TARGETS` registry in agentcli has no OpenClaw-cron target and should not gain one.
|
|
21
|
+
4. OpenClaw native cron remains intentionally non-durable compared to openclaw-scheduler. This is a deliberate tradeoff, not a gap to close. Native cron optimizes for simplicity and zero configuration; openclaw-scheduler optimizes for reliability and auditability.
|
|
22
|
+
|
|
23
|
+
## Decision Rule
|
|
24
|
+
|
|
25
|
+
If the automation needs any of the following, it belongs in openclaw-scheduler:
|
|
26
|
+
|
|
27
|
+
- Retry on failure
|
|
28
|
+
- Approval gates
|
|
29
|
+
- Workflow chaining (parent/child task relationships)
|
|
30
|
+
- Audit trail with queryable run history
|
|
31
|
+
- Guaranteed delivery (at-least-once semantics)
|
|
32
|
+
- Crash recovery and durable state
|
|
33
|
+
- Overlap policies (skip, queue, allow)
|
|
34
|
+
- Conditional triggers based on parent task outcome or output content
|
|
35
|
+
|
|
36
|
+
If the automation is a simple personal assistant convenience that can tolerate silent failure and does not need delivery confirmation, run history, or post-failure logic -- OpenClaw native cron is appropriate.
|
|
37
|
+
|
|
38
|
+
## Consequences
|
|
39
|
+
|
|
40
|
+
- agentcli manifests remain the single authoring surface for durable scheduled work. Users do not need to learn two scheduling APIs.
|
|
41
|
+
- OpenClaw native cron stays simple. It does not need to grow retry, approval, or chaining features because those concerns live in openclaw-scheduler.
|
|
42
|
+
- Operators can distinguish scheduler-dispatched runs from native cron jobs inside OpenClaw. Scheduler runs carry origin metadata (`origin: "system"`) and are visible through the scheduler's runs API.
|
|
43
|
+
- Triggered tasks in agentcli use the sentinel cron pattern `0 0 31 2 *` (February 31, which never fires) to satisfy the scheduler schema requirement for a cron field. Actual dispatch for triggered tasks is controlled by parent task outcome and the scheduler runtime queue, not by the sentinel cron.
|
|
44
|
+
- Adding new scheduling features (e.g., rate limiting, cost budgets, SLA monitoring) should happen in openclaw-scheduler, not in OpenClaw native cron or agentcli.
|
|
45
|
+
- Users who currently rely on OpenClaw native cron for simple automations do not need to migrate. The two systems coexist, and the decision rule above clarifies when to use each one.
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
### Example 1: Daily Status Summary
|
|
50
|
+
|
|
51
|
+
**As OpenClaw native cron:**
|
|
52
|
+
- Configure a cron job in OpenClaw that sends "summarize today's activity" to the assistant every day at 9am
|
|
53
|
+
- If the gateway is down at 9am, the job is silently skipped
|
|
54
|
+
- No retry, no delivery confirmation, no audit record
|
|
55
|
+
|
|
56
|
+
**As agentcli manifest via openclaw-scheduler:**
|
|
57
|
+
- Define a manifest with a scheduled task: cron "0 9 * * *", delivery_mode "announce", delivery_guarantee "at-least-once"
|
|
58
|
+
- If the first attempt fails, the scheduler retries (max_retries: 2)
|
|
59
|
+
- Result is delivered to the configured channel with guaranteed delivery
|
|
60
|
+
- Audit record tracks execution time, status, and output summary
|
|
61
|
+
|
|
62
|
+
### Example 2: Shell Health Check Every 5 Minutes
|
|
63
|
+
|
|
64
|
+
**As OpenClaw native cron:**
|
|
65
|
+
- Heartbeat fires a shell command every 5 minutes
|
|
66
|
+
- Output is not captured or delivered
|
|
67
|
+
- If the host is rebooting, checks are silently missed
|
|
68
|
+
|
|
69
|
+
**As agentcli manifest via openclaw-scheduler:**
|
|
70
|
+
- Define a manifest with session_target "shell", cron "*/5 * * * *", overlap_policy "skip"
|
|
71
|
+
- On failure, the scheduler can trigger a child alert task (trigger_on: "failure")
|
|
72
|
+
- Watchdog monitors the health check job itself
|
|
73
|
+
- Shell output stored and queryable via runs API
|