From a3938d62f60df4f320bc07370cafb2fc2110d978 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 11:06:37 +0000 Subject: [PATCH] chore: raise heartbeat ack window --- CHANGELOG.md | 5 +++++ docs/gateway/configuration-examples.md | 2 +- docs/gateway/configuration.md | 2 +- docs/gateway/heartbeat.md | 4 ++-- src/auto-reply/heartbeat.ts | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e1381b8e..c12fe6502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +# 2026.1.12-1 + +### Changes +- Heartbeat: raise default `ackMaxChars` to 300 so any `HEARTBEAT_OK` replies with short padding stay internal (fewer noisy heartbeat posts on providers). + ## 2026.1.11-5 ### Fixes diff --git a/docs/gateway/configuration-examples.md b/docs/gateway/configuration-examples.md index 3c39c0bbd..3456077d8 100644 --- a/docs/gateway/configuration-examples.md +++ b/docs/gateway/configuration-examples.md @@ -239,7 +239,7 @@ Save to `~/.clawdbot/clawdbot.json` and you can DM the bot from that number. target: "last", to: "+15555550123", prompt: "HEARTBEAT", - ackMaxChars: 30 + ackMaxChars: 300 }, sandbox: { mode: "non-main", diff --git a/docs/gateway/configuration.md b/docs/gateway/configuration.md index 3d82f475a..9ffb7c466 100644 --- a/docs/gateway/configuration.md +++ b/docs/gateway/configuration.md @@ -1463,7 +1463,7 @@ Z.AI models are available as `zai/` (e.g. `zai/glm-4.7`) and require - `target`: optional delivery provider (`last`, `whatsapp`, `telegram`, `discord`, `slack`, `signal`, `imessage`, `none`). Default: `last`. - `to`: optional recipient override (provider-specific id, e.g. E.164 for WhatsApp, chat id for Telegram). - `prompt`: optional override for the heartbeat body (default: `Read HEARTBEAT.md if exists. Consider outstanding tasks. Checkup sometimes on your human during (user local) day time.`). Overrides are sent verbatim; include a `Read HEARTBEAT.md if exists` line if you still want the file read. -- `ackMaxChars`: max chars allowed after `HEARTBEAT_OK` before delivery (default: 30). +- `ackMaxChars`: max chars allowed after `HEARTBEAT_OK` before delivery (default: 300). Heartbeats run full agent turns. Shorter intervals burn more tokens; be mindful of `every`, keep `HEARTBEAT.md` tiny, and/or choose a cheaper `model`. diff --git a/docs/gateway/heartbeat.md b/docs/gateway/heartbeat.md index 0cb109216..4ee9d8f0a 100644 --- a/docs/gateway/heartbeat.md +++ b/docs/gateway/heartbeat.md @@ -57,7 +57,7 @@ custom body (sent verbatim). - If nothing needs attention, reply with **`HEARTBEAT_OK`**. - During heartbeat runs, Clawdbot treats `HEARTBEAT_OK` as an ack when it appears at the **start or end** of the reply. The token is stripped and the reply is - dropped if the remaining content is **≤ `ackMaxChars`** (default: 30). + dropped if the remaining content is **≤ `ackMaxChars`** (default: 300). - If `HEARTBEAT_OK` appears in the **middle** of a reply, it is not treated specially. - For alerts, **do not** include `HEARTBEAT_OK`; return only the alert text. @@ -78,7 +78,7 @@ and logged; a message that is only `HEARTBEAT_OK` is dropped. target: "last", // last | whatsapp | telegram | discord | slack | signal | imessage | none to: "+15551234567", // optional provider-specific override prompt: "Read HEARTBEAT.md if exists. Consider outstanding tasks. Checkup sometimes on your human during (user local) day time.", - ackMaxChars: 30 // max chars allowed after HEARTBEAT_OK + ackMaxChars: 300 // max chars allowed after HEARTBEAT_OK } } } diff --git a/src/auto-reply/heartbeat.ts b/src/auto-reply/heartbeat.ts index b9d0ff13b..e1d4f6042 100644 --- a/src/auto-reply/heartbeat.ts +++ b/src/auto-reply/heartbeat.ts @@ -3,7 +3,7 @@ import { HEARTBEAT_TOKEN } from "./tokens.js"; export const HEARTBEAT_PROMPT = "Consider outstanding tasks and HEARTBEAT.md guidance from the workspace context (if present). Checkup sometimes on your human during (user local) day time."; export const DEFAULT_HEARTBEAT_EVERY = "30m"; -export const DEFAULT_HEARTBEAT_ACK_MAX_CHARS = 30; +export const DEFAULT_HEARTBEAT_ACK_MAX_CHARS = 300; export function resolveHeartbeatPrompt(raw?: string): string { const trimmed = typeof raw === "string" ? raw.trim() : "";