Where does an OpenClaw heartbeat deliver its alerts by default, and why might a poll be skipped with `reason=no-route`?
answer
- an owner, not the last chat
- commands.ownerAllowFrom, then allowFrom
- wildcards identify nobody
- target versus to
- skipped before the agent runs
basics
~20 sBy default target is owner: the first concrete entry in commands.ownerAllowFrom, then a channel allowFrom, as a direct message and never a group. With no resolvable owner DM, the poll is skipped as reason=no-route before the agent runs.
solid answer
~40 s`agents.defaults.heartbeat.target` defaults to `owner`. OpenClaw takes the first concrete `commands.ownerAllowFrom` entry, for example `"telegram:123456789"`, then a channel `allowFrom`, and delivers to that person's direct message; this route never resolves to a group. A wildcard-only allowlist identifies nobody, so with no concrete owner the poll is skipped as `reason=no-route` before the model is called. Other targets are opt-in: `last` follows the last external conversation, groups included; `none` runs for internal state only; a channel id such as `telegram` plus `to` names a recipient. `target` never takes a combined `telegram:123` value, that form belongs in `ownerAllowFrom`. Owner routing became the default in 2026.8.1, replacing reliance on the previous conversation.
code
bash · 2 linesopenclaw config set agents.defaults.heartbeat.target telegram
openclaw config set agents.defaults.heartbeat.to '"123456789"'go deeper
Recall that heartbeat alerts go to the owner's direct message by default and never to a group.
Explain how owner resolves from commands.ownerAllowFrom then allowFrom, why wildcards fail, and how target, to and session differ.
Diagnose silent heartbeats from skip reasons such as no-route, dm-blocked and alerts-disabled, and know which settings still spend a model call.
Decide when an assistant may ever speak in a shared room unprompted, and make last an explicit, reviewed exception rather than a convenience.
## Two questions: where the turn runs, where the alert goes A heartbeat has two independent routing settings, and confusing them is the root of most delivery bugs: - **`session`** decides the **run context**: the agent's main session by default, or an explicit session key. - **`target`** (with `to` and `accountId`) decides **delivery**: where an alert, if any, is sent. Changing `session` never changes where a message goes. Delivery is `target`'s job. ## The default: `target: "owner"` Since **2026.8.1** an ambient heartbeat sends its alerts to a resolvable **owner direct message** by default and skips polls it cannot route, instead of relying on whichever conversation happened last. In 2026.9.9 the `owner` target resolves like this: 1. Take the first **concrete** entry in **`commands.ownerAllowFrom`**, written as an array such as `["telegram:123456789"]`. 2. Otherwise fall back to a concrete entry in a channel's **`allowFrom`**. 3. Deliver to that identity as a **direct message**. This route never resolves to a group or channel. A **wildcard-only** allowlist (`"*"`) does not identify an owner. If nothing concrete and DM-capable resolves, the poll is skipped as **`reason=no-route`** before the agent runs, so no model call is spent. The first alert delivered through the implicit `owner` default also includes a line explaining periodic checks and how to choose `target: "none"`; later alerts omit it. ```json { "commands": { "ownerAllowFrom": ["telegram:123456789"] }, "agents": { "defaults": { "heartbeat": { "target": "owner" } } } } ``` When setting the owner from the CLI, pass a JSON array even for one entry and include any owners you want to keep: `openclaw config set commands.ownerAllowFrom '["telegram:123456789"]'`. ## The other targets | `target` | Delivers to | Use when | | --- | --- | --- | | `owner` (default) | the operator's DM, from `commands.ownerAllowFrom` then `allowFrom` | a personal assistant reporting to its owner | | `last` | the last external conversation used, **including groups** | you deliberately want alerts where you last talked | | a channel id such as `telegram`, `whatsapp`, `discord` | the recipient in `to` on that channel | a fixed ops chat or a specific number | | `none` | nowhere external | internal state updates only | Details that trip people up: - **`to` is separate from `target`.** For Telegram, use `target: "telegram"` and `to: "123456789"`; keep the inner quotes in `openclaw config set ... '"123456789"'` so the id is stored as a string. Topics use `<chatId>:topic:<messageThreadId>`. - **`target` never takes `"telegram:123456789"`.** That combined form is an owner identity and belongs in `commands.ownerAllowFrom`. - **`owner` and an unset target ignore `to`.** - **`accountId`** picks an account on multi-account channels; a value that matches no configured account skips delivery. - **`last` is an explicit opt-in to groups.** It also skips when the session has no external route. ## Policy switches that act after the target - **`directPolicy`** defaults to `allow`. `block` suppresses direct-message sends (`reason=dm-blocked`) while still running the turn, so it saves no model cost. - **`heartbeatVisibility`** per channel or account controls whether OKs (`showOk`), alerts (`showAlerts`) and indicator events (`useIndicator`) are emitted; if all three are false the run is skipped up front. - A wake that itself carries a channel and recipient uses that named origin before owner discovery, and that destination can be a group because it is explicit, not inferred. ## Diagnosing a silent heartbeat When heartbeats seem to do nothing, check `openclaw system heartbeat last` before blaming the model: - `no-route` means no owner resolved: add a concrete `commands.ownerAllowFrom` entry or set an explicit channel target. - `dm-blocked` means `directPolicy: "block"` is in effect. - `alerts-disabled` means the visibility flags switched everything off. Each of these is a delivery decision made by the Gateway, not something the agent chose.
- Why does an OpenClaw heartbeat with `target: "last"` sometimes post into a group chat?`last` follows the last used external conversation, and that includes groups and channels. It is an explicit opt-in, unlike the default `owner`, which only ever resolves to a direct message. If the owner last spoke to the agent in a group, the heartbeat alert lands there; switch back to `owner` or name a channel target with `to`.
- In OpenClaw, does setting the heartbeat `session` key change where alerts are delivered?No. `session` only chooses the run context, the main session by default or an explicit session key. Delivery is controlled by `target`, `to` and `accountId`. To move alerts, change the target; to change what conversation history the turn sees, change the session.
- Heartbeat alerts go to whichever chat the owner used last by default.
- An allowFrom of star is enough for the heartbeat to find its owner.
- You can set heartbeat target to telegram:123456789 in one value.
- Changing the heartbeat session key moves where alerts are sent.
- directPolicy block stops the heartbeat from running and saves tokens.
Assumes OpenClaw 2026.9.9; owner-directed ambient heartbeats with no-route skips became the default in 2026.8.1.