openclaw - 💡(How to fix) Fix Cron/heartbeat deliveries duplicated 2-6x per trigger [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59703Fetched 2026-04-08 02:41:36
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1

Fix Action

Workaround

Increased heartbeat interval from 5m to 15m to reduce the burn rate, but the underlying duplication remains.

RAW_BUFFERClick to expand / collapse

Bug Description

Cron jobs and heartbeat polls are being delivered to the agent session multiple times per trigger. Each scheduled event (cron or heartbeat) results in 2-6 duplicate deliveries in a single batch.

Environment

  • OpenClaw version: 2026.4.1
  • OS: macOS 15.7.3 (arm64), Node v25.8.2
  • Gateway: Local, LaunchAgent, single process
  • Channel: Telegram
  • Heartbeat interval: Was 5m, now 15m (workaround)

Reproduction

  1. Set up any cron job or heartbeat with every: 5m
  2. Wait for the next trigger
  3. Observe the agent session receives the same message 2-6 times in a single delivery batch

What we've tried

  • Confirmed cron store is clean: openclaw cron list shows 10 unique jobs, no duplicates
  • Gateway restart (openclaw gateway restart) — did not fix
  • Fresh session via /new — did not fix
  • Killed all zombie subagents — did not fix

Investigation findings

  • Gateway logs showed two simultaneous WebSocket connections from the Control UI (conn=99c83f3c webchat v2026.3.28 and conn=d9d51181 webchat vcontrol-ui), established within 4ms of each other
  • However, closing browser tabs and restarting gateway did not resolve the issue
  • The duplication count varies (2x, 3x, 4x, 6x) suggesting it may be related to the number of active WS connections or subscribers

Impact

  • Token burn: Each duplicate delivery loads the full agent context on an Opus-class model. At 5m heartbeat intervals with 3-6x duplication, this burned ~60% of API usage allowance in 5 hours with zero user activity.
  • Session context pollution: Duplicate messages fill the context window, triggering unnecessary compaction cycles.

Expected behavior

Each cron trigger and heartbeat poll should result in exactly one delivery to the target agent session.

Workaround

Increased heartbeat interval from 5m to 15m to reduce the burn rate, but the underlying duplication remains.

extent analysis

TL;DR

Investigate and adjust the WebSocket connection handling to prevent duplicate deliveries of cron jobs and heartbeat polls.

Guidance

  • Review the Gateway logs to understand the pattern of simultaneous WebSocket connections and their impact on message delivery.
  • Verify if the number of active WS connections or subscribers is directly related to the duplication count by testing with different numbers of connections.
  • Investigate the possibility of implementing a deduplication mechanism for incoming messages to prevent duplicate deliveries.
  • Consider implementing a rate limiter to restrict the frequency of message deliveries and prevent token burn.

Example

No specific code snippet can be provided without further information on the OpenClaw implementation details.

Notes

The provided information suggests a correlation between the number of WebSocket connections and the duplication count, but further investigation is needed to confirm this relationship.

Recommendation

Apply a workaround by implementing a deduplication mechanism or a rate limiter to prevent duplicate deliveries and reduce token burn, as upgrading to a fixed version is not mentioned as an option in the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Each cron trigger and heartbeat poll should result in exactly one delivery to the target agent session.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Cron/heartbeat deliveries duplicated 2-6x per trigger [1 comments, 2 participants]