You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cron): default isolated jobs to announce delivery and enhance scheduling options
- Updated isolated cron jobs to default to `announce` delivery mode, improving user experience.
- Enhanced scheduling options to accept ISO 8601 timestamps for `schedule.at`, while still supporting epoch milliseconds.
- Refined documentation to clarify delivery modes and scheduling formats.
- Adjusted related CLI commands and UI components to reflect these changes, ensuring consistency across the platform.
- Improved handling of legacy delivery fields for backward compatibility.
This update streamlines the configuration of isolated jobs, making it easier for users to manage job outputs and schedules.
Copy file name to clipboardExpand all lines: docs/automation/cron-jobs.md
+15-10Lines changed: 15 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ cron is the mechanism.
23
23
- Jobs persist under `~/.openclaw/cron/` so restarts don’t lose schedules.
24
24
- Two execution styles:
25
25
-**Main session**: enqueue a system event, then run on the next heartbeat.
26
-
-**Isolated**: run a dedicated agent turn in `cron:<jobId>`, with a delivery mode (legacy summary, announce, full output, or none).
26
+
-**Isolated**: run a dedicated agent turn in `cron:<jobId>`, with delivery (announce by default, full output or none; legacy main summary still supported).
27
27
- Wakeups are first-class: a job can request “wake now” vs “next heartbeat”.
28
28
29
29
## Quick start (actionable)
@@ -108,7 +108,7 @@ Jobs can optionally auto-delete after a successful one-shot run via `deleteAfter
108
108
109
109
Cron supports three schedule kinds:
110
110
111
-
-`at`: one-shot timestamp (ms since epoch). Gateway accepts ISO 8601 and coerces to UTC.
111
+
-`at`: one-shot timestamp. Prefer ISO 8601 via `schedule.at`; `atMs` (epoch ms) is also accepted.
112
112
-`every`: fixed interval (ms).
113
113
-`cron`: 5-field cron expression with optional IANA timezone.
114
114
@@ -136,12 +136,13 @@ Key behaviors:
136
136
137
137
- Prompt is prefixed with `[cron:<jobId> <job name>]` for traceability.
138
138
- Each run starts a **fresh session id** (no prior conversation carry-over).
139
-
- Legacy behavior (no `delivery` field): a summary is posted to the main session (prefix `Cron`, configurable).
139
+
- Default behavior: if `delivery` is omitted, isolated jobs announce a summary immediately (`delivery.mode = "announce"`), unless legacy isolation settings or legacy payload delivery fields are provided.
140
+
- Legacy behavior: jobs with legacy isolation settings, legacy payload delivery fields, or older stored jobs without `delivery` post a summary to the main session (prefix `Cron`, configurable).
140
141
-`delivery.mode` (isolated-only) chooses what happens instead of the legacy summary:
141
142
-`announce`: subagent-style summary delivered immediately to a chat.
142
143
-`deliver`: full agent output delivered immediately to a chat.
143
144
-`none`: internal only (no main summary, no delivery).
144
-
-`wakeMode: "now"` triggers an immediate heartbeat after posting the **legacy**summary.
145
+
-`wakeMode: "now"`only triggers an immediate heartbeat when using the legacy main-summary path.
145
146
146
147
Use isolated jobs for noisy, frequent, or "background chores" that shouldn't spam
147
148
your main chat history.
@@ -166,6 +167,9 @@ Delivery config (isolated jobs only):
-`delivery.bestEffort`: avoid failing the job if delivery fails (deliver mode).
168
169
170
+
If `delivery` is omitted for isolated jobs, OpenClaw defaults to `announce` unless legacy isolation
171
+
settings are present.
172
+
169
173
Legacy delivery fields (still accepted when `delivery` is omitted):
170
174
171
175
-`payload.deliver`: `true` to send output to a channel target.
@@ -179,7 +183,7 @@ Isolation options (only for `session=isolated`):
179
183
-`postToMainMode`: `summary` (default) or `full`.
180
184
-`postToMainMaxChars`: max chars when `postToMainMode=full` (default 8000).
181
185
182
-
Note: isolation post-to-main settings apply to legacy jobs (no `delivery` field). If `delivery` is set, the legacy summary is skipped.
186
+
Note: setting isolation post-to-main options opts into the legacy main-summary path (no `delivery` field). If `delivery` is set, the legacy summary is skipped.
183
187
184
188
### Model and thinking overrides
185
189
@@ -211,7 +215,7 @@ Delivery config is only valid for isolated jobs (`sessionTarget: "isolated"`).
211
215
If `delivery.channel` or `delivery.to` is omitted, cron can fall back to the main session’s
212
216
“last route” (the last place the agent replied).
213
217
214
-
Legacy behavior (no `delivery` field):
218
+
Legacy behavior (no `delivery` field with legacy isolation settings or older jobs):
215
219
216
220
- If `payload.to` is set, cron auto-delivers the agent’s final output even if `payload.deliver` is omitted.
217
221
- Use `payload.deliver: true` when you want last-route delivery without an explicit `to`.
@@ -240,8 +244,8 @@ Prefixed targets like `telegram:...` / `telegram:group:...` are also accepted:
240
244
## JSON schema for tool calls
241
245
242
246
Use these shapes when calling Gateway `cron.*` tools directly (agent tool calls or RPC).
243
-
CLI flags accept human durations like `20m`, but tool calls use epoch milliseconds for
244
-
`atMs` and `everyMs` (ISO timestamps are accepted for `at` times).
247
+
CLI flags accept human durations like `20m`, but tool calls should use an ISO 8601 string
248
+
for `schedule.at` (preferred) or epoch milliseconds for `atMs` and `everyMs`.
245
249
246
250
### cron.add params
247
251
@@ -250,7 +254,7 @@ One-shot, main session job (system event):
Copy file name to clipboardExpand all lines: docs/automation/cron-vs-heartbeat.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ Cron jobs run at **exact times** and can run in isolated sessions without affect
90
90
-**Exact timing**: 5-field cron expressions with timezone support.
91
91
-**Session isolation**: Runs in `cron:<jobId>` without polluting main history.
92
92
-**Model overrides**: Use a cheaper or more powerful model per job.
93
-
-**Delivery control**: Choose `announce` (summary), `deliver` (full output), or `none`. Legacy jobs still post a summary to main by default.
93
+
-**Delivery control**: Isolated jobs default to `announce` (summary); choose `deliver` (full output) or `none` as needed. Legacy jobs still post a summary to main.
94
94
-**Immediate delivery**: Announce/deliver modes post directly without waiting for heartbeat.
95
95
-**No agent context needed**: Runs even if main session is idle or compacted.
96
96
-**One-shot support**: `--at` for precise future timestamps.
@@ -215,13 +215,13 @@ See [Lobster](/tools/lobster) for full usage and examples.
215
215
216
216
Both heartbeat and cron can interact with the main session, but differently:
0 commit comments