openclaw/docs/reference
JustYannicc dd06028827
feat(heartbeat): skip API calls when HEARTBEAT.md is effectively empty (#1535)
* feat: skip heartbeat API calls when HEARTBEAT.md is effectively empty

- Added isHeartbeatContentEffectivelyEmpty() to detect files with only headers/comments
- Modified runHeartbeatOnce() to check HEARTBEAT.md content before polling the LLM
- Returns early with 'empty-heartbeat-file' reason when no actionable tasks exist
- Preserves existing behavior when file is missing (lets LLM decide)
- Added comprehensive test coverage for empty file detection
- Saves API calls/costs when heartbeat file has no meaningful content

* chore: update HEARTBEAT.md template to be effectively empty by default

Changed instruction text to comment format so new workspaces benefit from
heartbeat optimization immediately. Users still get clear guidance on usage.

* fix: only treat markdown headers (# followed by space) as comments, not #TODO etc

* refactor: simplify regex per code review suggestion

* docs: clarify heartbeat empty file behavior (#1535) (thanks @JustYannicc)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-01-24 04:19:01 +00:00
..
templates feat(heartbeat): skip API calls when HEARTBEAT.md is effectively empty (#1535) 2026-01-24 04:19:01 +00:00
AGENTS.default.md docs: complete channels rename sweep 2026-01-13 08:40:39 +00:00
RELEASING.md docs: prefer fast install smoke for release 2026-01-23 09:18:15 +00:00
api-usage-costs.md docs: add api usage and costs overview 2026-01-18 14:55:09 +00:00
device-models.md docs: reorganize documentation structure 2026-01-07 00:45:46 +01:00
rpc.md refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
session-management-compaction.md docs: add transcript hygiene reference 2026-01-23 01:34:21 +00:00
test.md docs: document testing kit 2026-01-10 01:15:47 +00:00
transcript-hygiene.md docs: add transcript hygiene reference 2026-01-23 01:34:21 +00:00