openclaw - 💡(How to fix) Fix [2026.5.18] Compaction safeguard causes duplicate messages on sessions_send interactions [2 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#84139Fetched 2026-05-20 03:43:36
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
1
Author
Timeline (top)
labeled ×5commented ×2cross-referenced ×1

Code Example

21:07:40 [ws] ⇄ res ✓ agent.wait 8153ms conn=8d3cc9d1…d1ab id=193b25a2…6716
21:07:40 [agent:nested] session=agent:pm:main run=f2b16e7b-02d8-44fd-9248-47b5e1dd3c41 channel=webchat 🐝
21:07:48 [ws] ⇄ res ✓ agent.wait 8299ms conn=565514c9…c6bb id=fec29339…f5cd
21:07:51 [compaction-safeguard] Compaction safeguard: using session branch messages after compaction preparation omitted real conversation content.
21:07:51 [agent:nested] session=agent:main:main run=e8352a29-4146-4a65-8c57-c8dcdc19a4a1 channel=webchat 🐝
21:08:19 [ws] ⇄ res ✓ agent.wait 60001ms conn=c4ad3534…96e0 id=130ae42b…45f7
RAW_BUFFERClick to expand / collapse

Bug Description

When compaction triggers during an active sessions_send exchange between two agents, the compaction safeguard replays the session branch messages after recovery, causing the same interaction to be sent twice to the target agent.

Example scenario:

  1. Agent PM sends a sessions_send to 小蜂 (this agent)
  2. 小蜂 processes and replies with a simple emoji 🐝
  3. 小蜂 sends sessions_send reply back to PM
  4. Compaction triggers at this moment
  5. After compaction recovery, the safeguard replays the session branch → 小蜂 sends another 🐝 to PM
  6. Result: PM receives 🐝 twice

Steps to Reproduce

  1. Have two agents exchange messages via sessions_send
  2. Wait for compaction to trigger during the exchange (context积累到阈值)
  3. Observe that the message sent during the recovery period appears twice in the target session

Expected Behavior

Each sessions_send interaction should be delivered exactly once. Compaction should not cause duplicate delivery of messages that were already sent.

Actual Behavior

Messages delivered via sessions_send are duplicated after compaction recovery. The safeguard appears to replay the session branch containing the sessions_send interaction, causing duplicate delivery.

Gateway Log

21:07:40 [ws] ⇄ res ✓ agent.wait 8153ms conn=8d3cc9d1…d1ab id=193b25a2…6716
21:07:40 [agent:nested] session=agent:pm:main run=f2b16e7b-02d8-44fd-9248-47b5e1dd3c41 channel=webchat 🐝
21:07:48 [ws] ⇄ res ✓ agent.wait 8299ms conn=565514c9…c6bb id=fec29339…f5cd
21:07:51 [compaction-safeguard] Compaction safeguard: using session branch messages after compaction preparation omitted real conversation content.
21:07:51 [agent:nested] session=agent:main:main run=e8352a29-4146-4a65-8c57-c8dcdc19a4a1 channel=webchat 🐝
21:08:19 [ws] ⇄ res ✓ agent.wait 60001ms conn=c4ad3534…96e0 id=130ae42b…45f7

Key line: Compaction safeguard: using session branch messages after compaction preparation omitted real conversation content.

The safeguard falls back to branch messages when real content is omitted during compaction preparation, but this replay includes already-sent sessions_send interactions.

Environment

  • OS: macOS Darwin 25.4.0 (arm64)
  • OpenClaw: 2026.5.18 (50a2481)
  • Node: v25.9.0
  • Model: minimax/MiniMax-M2.7
  • Compaction provider: compaction-weighted 1.0.0

Additional Context

  • This only affects inter-agent sessions_send interactions, not direct user↔agent messages
  • The duplication is 偶发 — only triggers when compaction hits during an active exchange
  • User reports it as acceptable as a known system-layer issue if fix is low priority
  • Related: #80285 fix: clear cross-run messaging-tool sent-text state after every compaction (may be related but different 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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING