diff --git a/CHANGELOG.md b/CHANGELOG.md index eeffe7eeac..c5476015d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Docs: https://docs.openclaw.ai - Docs: clarify tmux send-keys for TUI by splitting text and Enter. (#7737) Thanks @Wangnov. - Docs: mirror the landing page revamp for zh-CN (features, quickstart, docs directory, network model, credits). (#8994) Thanks @joshp123. - Docs: strengthen secure DM mode guidance for multi-user inboxes with an explicit warning and example. (#9377) Thanks @Shrinija17. +- Docs: document `activeHours` heartbeat field with timezone resolution chain and example. (#9366) Thanks @unisone. - Messages: add per-channel and per-account responsePrefix overrides across channels. (#9001) Thanks @mudrii. - Cron: add announce delivery mode for isolated jobs (CLI + Control UI) and delivery mode config. - Cron: default isolated jobs to announce delivery; accept ISO 8601 `schedule.at` in tool inputs. diff --git a/docs/gateway/heartbeat.md b/docs/gateway/heartbeat.md index 287581ab29..f9ab1caf2f 100644 --- a/docs/gateway/heartbeat.md +++ b/docs/gateway/heartbeat.md @@ -137,6 +137,30 @@ Example: two agents, only the second agent runs heartbeats. } ``` +### Active hours example + +Restrict heartbeats to business hours in a specific timezone: + +```json5 +{ + agents: { + defaults: { + heartbeat: { + every: "30m", + target: "last", + activeHours: { + start: "09:00", + end: "22:00", + timezone: "America/New_York", // optional; uses your userTimezone if set, otherwise host tz + }, + }, + }, + }, +} +``` + +Outside this window (before 9am or after 10pm Eastern), heartbeats are skipped. The next scheduled tick inside the window will run normally. + ### Multi account example Use `accountId` to target a specific account on multi-account channels like Telegram: @@ -183,6 +207,11 @@ Use `accountId` to target a specific account on multi-account channels like Tele - `accountId`: optional account id for multi-account channels. When `target: "last"`, the account id applies to the resolved last channel if it supports accounts; otherwise it is ignored. If the account id does not match a configured account for the resolved channel, delivery is skipped. - `prompt`: overrides the default prompt body (not merged). - `ackMaxChars`: max chars allowed after `HEARTBEAT_OK` before delivery. +- `activeHours`: restricts heartbeat runs to a time window. Object with `start` (HH:MM, inclusive), `end` (HH:MM exclusive; `24:00` allowed for end-of-day), and optional `timezone`. + - Omitted or `"user"`: uses your `agents.defaults.userTimezone` if set, otherwise falls back to the host system timezone. + - `"local"`: always uses the host system timezone. + - Any IANA identifier (e.g. `America/New_York`): used directly; if invalid, falls back to the `"user"` behavior above. + - Outside the active window, heartbeats are skipped until the next tick inside the window. ## Delivery behavior