openclaw/docs/gateway
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
..
authentication.md
background-process.md
bonjour.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
bridge-protocol.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
cli-backends.md
configuration-examples.md docs: update media auto-detect 2026-01-23 05:47:16 +00:00
configuration.md fix: honor wildcard tool allowlists 2026-01-24 01:30:44 +00:00
discovery.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
doctor.md
gateway-lock.md
health.md
heartbeat.md feat(heartbeat): skip API calls when HEARTBEAT.md is effectively empty (#1535) 2026-01-24 04:19:01 +00:00
index.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
local-models.md
logging.md fix: improve tool summaries 2026-01-23 01:00:24 +00:00
multiple-gateways.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
openai-http-api.md
openresponses-http-api.md
pairing.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
protocol.md
remote-gateway-readme.md
remote.md docs: fix remaining node ws references 2026-01-22 23:22:56 +00:00
sandbox-vs-tool-policy-vs-elevated.md feat: add elevated ask/full modes 2026-01-22 05:41:11 +00:00
sandboxing.md
security.md docs: clarify prompt injection guidance 2026-01-22 04:19:33 +00:00
tailscale.md docs: fix remaining node ws references 2026-01-22 23:22:56 +00:00
troubleshooting.md fix: warn on unset gateway.mode 2026-01-22 00:21:08 +00:00