#17006: fix(heartbeat): skip delivery when showOk is false
stale
size: XS
Cluster:
Heartbeat Message Filtering
Fixes #16974
## Problem
When showOk is set to false, HEARTBEAT_OK responses still leak to the channel instead of being suppressed.
## Solution
Skip main heartbeat delivery when visibility.showOk is false, in addition to existing skip logic for HEARTBEAT_TOKEN responses.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds a `shouldSkipDueToShowOk` check to skip heartbeat delivery when `visibility.showOk` is `false`. However, the condition `!visibility.showOk` is too broad — since `showOk` defaults to `false` (in `heartbeat-visibility.ts`), this change will suppress **all** heartbeat deliveries (including substantive alert content) under default configuration when no reasoning payloads are present.
- The existing code already correctly suppresses `HEARTBEAT_OK` token delivery via `shouldSkipMain` (based on `normalized.shouldSkip`) and `canAttemptHeartbeatOk` (which checks `visibility.showOk`)
- The new `shouldSkipDueToShowOk = !visibility.showOk` unconditionally blocks the main delivery path, even for real content responses that should be delivered
- Under default settings, this regression would silently drop all heartbeat alert messages to channels
<h3>Confidence Score: 1/5</h3>
- This PR introduces a regression that would silently suppress all heartbeat alert delivery under default configuration.
- The condition `shouldSkipDueToShowOk = !visibility.showOk` evaluates to `true` under default settings (showOk defaults to false). Combined with `reasoningPayloads.length === 0` (the common case), this causes the early-return skip path to trigger for ALL heartbeat responses — not just HEARTBEAT_OK tokens. The existing code already handles HEARTBEAT_OK suppression correctly via `shouldSkipMain` and `canAttemptHeartbeatOk`.
- `src/infra/heartbeat-runner.ts` — the `shouldSkipDueToShowOk` condition on line 610 needs to be scoped more narrowly to avoid suppressing substantive heartbeat content.
<sub>Last reviewed commit: 3a900b2</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#12774: fix: webchat heartbeat should respect showAlerts config
by a2093930 · 2026-02-09
80.4%
#15575: fix(heartbeat): suppress prefixed HEARTBEAT_OK ack replies (#15505)
by TsekaLuk · 2026-02-13
78.1%
#17371: fix(heartbeat): always strip HEARTBEAT_OK token from reply text
by BinHPdev · 2026-02-15
76.2%
#21014: fix(cron): suppress main-session summary for HEARTBEAT_OK responses
by nickjlamb · 2026-02-19
75.9%
#11661: fix: Filter HEARTBEAT_OK from chat.history when showOk is false
by veast · 2026-02-08
75.7%
#12837: fix(heartbeat): suppress HEARTBEAT_OK token delivery
by JBrady · 2026-02-09
74.9%
#23588: fix(auto-reply): suppress repetitive HEARTBEAT_OK loops
by mohandshamada · 2026-02-22
74.6%
#16321: Fix #12767: suppress HEARTBEAT_OK leakage in Telegram DM replies
by tdjackey · 2026-02-14
74.4%
#12240: fix: suppress heartbeat agent events from webchat broadcast
by Yida-Dev · 2026-02-09
74.4%
#11859: fix: filter HEARTBEAT_OK messages from chat.history when showOk is ...
by Zjianru · 2026-02-08
74.3%