openclaw - 💡(How to fix) Fix Replay/dedup bug can redeliver prior cron and Matrix events into the same session [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#63254Fetched 2026-04-09 07:56:15
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

OpenClaw can replay or redeliver previously handled work into the same effective session. This has been observed both with scheduled reminders/heartbeats and with Matrix inbound traffic after restart/recovery activity.

Error Message

  • Single logical heartbeat/reminder fires reappeared more than once in the main session.
  • Charlie's Matrix review found 57 inbound deliveries from 26 unique Matrix event_ids; 22/26were replayed2–4x`.
  • Cleaning up duplicated Matrix account/listener state reduced one symptom but did not fully eliminate the broader replay/recovery behavior.

Root Cause

OpenClaw can replay or redeliver previously handled work into the same effective session. This has been observed both with scheduled reminders/heartbeats and with Matrix inbound traffic after restart/recovery activity.

RAW_BUFFERClick to expand / collapse

Replay/dedup bug can redeliver prior cron and Matrix events into the same session

Summary

OpenClaw can replay or redeliver previously handled work into the same effective session. This has been observed both with scheduled reminders/heartbeats and with Matrix inbound traffic after restart/recovery activity.

Expected behavior

Each underlying event should be delivered once to the target session unless there is an explicitly surfaced retry with idempotent semantics.

Observed behavior

  • Single logical heartbeat/reminder fires reappeared more than once in the main session.
  • Charlie's Matrix review found 57 inbound deliveries from 26 unique Matrix event_ids; 22/26were replayed2–4x`.
  • Cleaning up duplicated Matrix account/listener state reduced one symptom but did not fully eliminate the broader replay/recovery behavior.

Impact

  • duplicate operational work
  • repeated heartbeat handling
  • misleading session state
  • elevated risk of repeated side effects when handlers are not perfectly idempotent

Environment

  • Haywood (macOS, Apple Silicon)
  • OpenClaw 2026.4.2 line observed locally
  • heartbeat + Matrix + Gmail hooks in use

Evidence

  1. heartbeat/reminder duplicate chains observed in the main session
  2. Matrix replay counts: 57 deliveries / 26 unique event_ids; 22/26replayed2–4x`
  3. one-account Matrix cleanup completed later, but replay-path instability still remained

Reproduction sketch

  1. configure a scheduled reminder/cron targeting the main session
  2. allow it to fire once
  3. restart/reconnect the gateway in the surrounding window
  4. compare transcript deliveries vs the underlying scheduled fire count
  5. repeat with Matrix traffic and compare processed deliveries vs unique Matrix event_ids

Notes / hypotheses

  • delivery acknowledgement may not be durably committed
  • restart/recovery path may replay prior queued work
  • scheduler and Matrix intake may both lack a strong dedup key at the point work is enqueued into the session

extent analysis

TL;DR

Implementing a strong deduplication key for both scheduled reminders and Matrix events may prevent replaying of prior events into the same session.

Guidance

  • Investigate the delivery acknowledgement mechanism to ensure it is durably committed, preventing replay of already processed events.
  • Review the restart/recovery path to identify why prior queued work is being replayed and implement a fix to prevent this behavior.
  • Introduce a unique deduplication key for both scheduler and Matrix intake to prevent duplicate events from being enqueued into the session.
  • Verify the effectiveness of these changes by repeating the reproduction sketch and comparing the results.

Example

No specific code snippet can be provided without more details on the implementation, but ensuring that each event (whether from scheduled reminders or Matrix events) has a unique identifier that can be checked against before processing could help prevent duplicates.

Notes

The exact implementation details of the scheduler, Matrix intake, and delivery acknowledgement mechanisms are not provided, which limits the specificity of the guidance. However, focusing on durable acknowledgement and unique deduplication keys should help mitigate the issue.

Recommendation

Apply a workaround by introducing a deduplication mechanism for events, as the root cause seems to be related to the lack of a strong dedup key and potentially non-durable delivery acknowledgements. This approach is chosen because it directly addresses the observed behavior and hypothesized causes without requiring an upgrade to a potentially non-existent fixed version.

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 underlying event should be delivered once to the target session unless there is an explicitly surfaced retry with idempotent semantics.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING