openclaw/docs/reference/templates
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
..
AGENTS.dev.md feat: add dev workspace templates 2026-01-09 16:13:41 +01:00
AGENTS.md docs: add cron vs heartbeat decision guide 2026-01-24 00:42:56 +00:00
BOOT.md feat(hooks): run boot.md on gateway startup 2026-01-18 11:50:25 +02:00
BOOTSTRAP.md docs: clarify bootstrap memory absence 2026-01-22 10:48:07 +00:00
HEARTBEAT.md feat(heartbeat): skip API calls when HEARTBEAT.md is effectively empty (#1535) 2026-01-24 04:19:01 +00:00
IDENTITY.dev.md feat: add agent avatar support (#1329) (thanks @dlauer) 2026-01-22 04:00:07 +00:00
IDENTITY.md feat: add agent identity avatars (#1329) (thanks @dlauer) 2026-01-22 05:37:15 +00:00
SOUL.dev.md feat: add dev workspace templates 2026-01-09 16:13:41 +01:00
SOUL.md docs: reorganize documentation structure 2026-01-07 00:45:46 +01:00
TOOLS.dev.md feat: add dev workspace templates 2026-01-09 16:13:41 +01:00
TOOLS.md docs: reorganize documentation structure 2026-01-07 00:45:46 +01:00
USER.dev.md feat: add dev workspace templates 2026-01-09 16:13:41 +01:00
USER.md docs: reorganize documentation structure 2026-01-07 00:45:46 +01:00