Skip to content

fix(cron): skip delivery for HEARTBEAT_OK responses - #238

Merged
steipete merged 1 commit into
openclaw:mainfrom
jalehman:fix/heartbeat-ok-delivery-filter
Jan 5, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
jalehman:fix/heartbeat-ok-delivery-filter

Conversation

@jalehman

@jalehman jalehman commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

Problem

Isolated cron jobs with deliver: true were sending HEARTBEAT_OK responses to external channels (Telegram, etc.), causing spam when there was nothing to report.

Solution

Added isHeartbeatOnlyResponse() helper in src/cron/isolated-agent.ts that checks if the response is just HEARTBEAT_OK (with optional whitespace). When detected, external delivery is skipped while still posting to main session via postToMainPrefix.

Changes

  • src/cron/isolated-agent.ts: Added check before delivery block
  • src/cron/isolated-agent.test.ts: Added 4 tests covering exact match, padding, substantial content, and media presence

Testing

  • HEARTBEAT_OK responses: filtered, not delivered
  • Actual content: delivered normally
  • Responses with media: delivered regardless of text

@steipete

steipete commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

Thanks Josh, this is a great fix!

@jalehman

jalehman commented Jan 5, 2026

Copy link
Copy Markdown
Contributor Author

Glad to hear! I'm having tons of fun with this project.

When an isolated cron job has deliver:true, skip message delivery if the
response is just HEARTBEAT_OK (or contains HEARTBEAT_OK at edges with
short remaining content <= 30 chars). This allows cron jobs to silently
ack when nothing to report but still deliver actual content when there
is something meaningful to say.

Media is still delivered even if text is HEARTBEAT_OK, since the
presence of media indicates there's something to share.
@jalehman
jalehman force-pushed the fix/heartbeat-ok-delivery-filter branch from fed930b to 93ab58d Compare January 5, 2026 21:52
@steipete
steipete merged commit dae7f56 into openclaw:main Jan 5, 2026
dgarson added a commit to dgarson/clawdbot that referenced this pull request Feb 9, 2026
openclaw#238)

* gateway: unify exec and tool approval pending state into single ToolApprovalManager

Route legacy exec.approval.request|resolve through canonical ToolApprovalManager
so there is one pending-approval state machine. Add resolveCompat() for legacy
callers that only provide { id, decision } without requestHash. Both legacy and
canonical events emit correctly for exec-origin requests. Anti-stale requestHash
validation remains effective for canonical tool.approval.resolve callers.

* chore: fix import ordering (formatter)

* gateway: add comprehensive unification tests and clean up dead comments

Add cross-resolution tests validating exec requests resolved via
tool.approval.resolve and vice versa. Add resolveCompat unit tests,
tool.approvals.get exec-visibility test, timeout/expiry test, forwarder
integration test, and legacy event shape validation test. Remove stale
import comments from server.impl.ts.

* Docs: require pnpm install at workspace start

---------

Co-authored-by: Claude <[email protected]>
dgarson added a commit to dgarson/clawdbot that referenced this pull request Feb 22, 2026
… (wire all); fix nav+skeleton for openclaw#235-237 (DatabaseSchemaViewer, DeploymentEnvironmentManager, MLExperimentTracker)
Fato07 referenced this pull request in Fato07/elav Mar 26, 2026
fix(scripts): use shell on Windows to fix spawn EINVAL in dev-runner
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
When an isolated cron job has deliver:true, skip message delivery if the
response is just HEARTBEAT_OK (or contains HEARTBEAT_OK at edges with
short remaining content <= 30 chars). This allows cron jobs to silently
ack when nothing to report but still deliver actual content when there
is something meaningful to say.

Media is still delivered even if text is HEARTBEAT_OK, since the
presence of media indicates there's something to share.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
When an isolated cron job has deliver:true, skip message delivery if the
response is just HEARTBEAT_OK (or contains HEARTBEAT_OK at edges with
short remaining content <= 30 chars). This allows cron jobs to silently
ack when nothing to report but still deliver actual content when there
is something meaningful to say.

Media is still delivered even if text is HEARTBEAT_OK, since the
presence of media indicates there's something to share.
muneebhashone pushed a commit to muneebhashone/clawdbot that referenced this pull request Aug 25, 2026
When an isolated cron job has deliver:true, skip message delivery if the
response is just HEARTBEAT_OK (or contains HEARTBEAT_OK at edges with
short remaining content <= 30 chars). This allows cron jobs to silently
ack when nothing to report but still deliver actual content when there
is something meaningful to say.

Media is still delivered even if text is HEARTBEAT_OK, since the
presence of media indicates there's something to share.
zeekay pushed a commit to Dream-AI-4444/bot that referenced this pull request Sep 11, 2026
When an isolated cron job has deliver:true, skip message delivery if the
response is just HEARTBEAT_OK (or contains HEARTBEAT_OK at edges with
short remaining content <= 30 chars). This allows cron jobs to silently
ack when nothing to report but still deliver actual content when there
is something meaningful to say.

Media is still delivered even if text is HEARTBEAT_OK, since the
presence of media indicates there's something to share.
lhfer pushed a commit to lhfer/openclaw that referenced this pull request Oct 11, 2026
When an isolated cron job has deliver:true, skip message delivery if the
response is just HEARTBEAT_OK (or contains HEARTBEAT_OK at edges with
short remaining content <= 30 chars). This allows cron jobs to silently
ack when nothing to report but still deliver actual content when there
is something meaningful to say.

Media is still delivered even if text is HEARTBEAT_OK, since the
presence of media indicates there's something to share.
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.

2 participants