#12365: test(heartbeat): don't skip empty HEARTBEAT.md for cron wake events
docs
gateway
stale
Cluster:
Heartbeat Functionality Improvements
Adds regression test to ensure cron wake events (reason=cron:*) are not skipped by the empty-HEARTBEAT.md optimization.\n\nContext: #11766
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the heartbeat documentation to clarify that an empty `HEARTBEAT.md` currently causes heartbeat runs to be skipped, and notes common scenarios (e.g., bootstrap creating an empty file) and workarounds.
It also adds a regression test in `src/infra/heartbeat-runner.returns-default-unset.test.ts` to assert that when the wake reason is `cron:*`, `runHeartbeatOnce` should not apply the “empty HEARTBEAT.md” optimization and should still run the heartbeat (including calling `getReplyFromConfig` and sending the configured outbound message).
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Changes are limited to a documentation clarification and a targeted regression test. The new test matches the current `runHeartbeatOnce` behavior (cron reasons bypass the empty-HEARTBEAT skip) and does not introduce production code changes.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#3335: Fixes cron jobs
by hkirat · 2026-01-28
87.5%
#6094: auto-reply: ignore HTML comments in heartbeat check
by rudrapanchal81 · 2026-02-01
81.6%
#5498: Cron: honor next-heartbeat
by sebslight · 2026-01-31
80.9%
#15422: fix(auto-reply): keep cron systemEvent payloads that start with 'Re...
by liuxiaopai-ai · 2026-02-13
80.3%
#8418: fix: notify user after consecutive heartbeat/cron failures
by liaosvcaf · 2026-02-04
80.0%
#11807: fix: Make HEARTBEAT.md creation match documentation
by HenryLoenwind · 2026-02-08
79.8%
#21014: fix(cron): suppress main-session summary for HEARTBEAT_OK responses
by nickjlamb · 2026-02-19
79.8%
#6522: fix(cron): deliver original message when agent response is heartbea...
by sidmohan0 · 2026-02-01
79.1%
#20521: feat(heartbeat): inject active cron job summary into heartbeat prompt
by maximalmargin · 2026-02-19
78.0%
#11657: fix(cron): treat skipped heartbeat as ok for one-shot jobs
by DukeDeSouth · 2026-02-08
77.4%