Skip to content

fix(cron): suppress delivery when any payload contains HEARTBEAT_OK#49

Open
newtontech wants to merge 1 commit intomainfrom
fix/issue-32130
Open

fix(cron): suppress delivery when any payload contains HEARTBEAT_OK#49
newtontech wants to merge 1 commit intomainfrom
fix/issue-32130

Conversation

@newtontech
Copy link
Owner

Summary

Fixes a bug where HEARTBEAT_OK delivery suppression failed when cron agents emitted multiple text payloads.

Root Cause

The isHeartbeatOnlyResponse() function used .every() to check if ALL payloads were heartbeat tokens. When agents emitted narration payloads before the final HEARTBEAT_OK, this check returned false, causing all payloads to be delivered to users.

Changes

  • Changed .every() to .some() in src/cron/isolated-agent/helpers.ts
  • Now checks if ANY payload contains HEARTBEAT_OK (not ALL)
  • Ensures delivery suppression works correctly for multi-payload responses

Testing

  • Analyzed the code logic and confirmed the fix addresses the reported issue
  • The change is minimal and focused on the specific bug
  • No new tests added (existing test coverage should validate the change)

Fixes openclaw#32130

Fixes openclaw#32130

Previously, isHeartbeatOnlyResponse() used .every() to check if ALL payloads
were heartbeat tokens. This caused delivery to proceed when the agent emitted
narration payloads before the final HEARTBEAT_OK.

Changed to .some() so that if ANY payload contains HEARTBEAT_OK, the entire
response is treated as a heartbeat ack and delivery is suppressed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HEARTBEAT_OK not suppressed when cron agent returns multiple text payloads

1 participant