openclaw - 💡(How to fix) Fix [Bug]: Zalo (zalouser) delivers document media twice for a single MEDIA: directive (images unaffected)

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…

On the Zalo personal (zalouser) channel, when an assistant reply contains a single MEDIA: directive pointing to a document (e.g. .xlsx), the file is delivered twice as two separate attachment messages in the same turn. Images sent the same way appear only once.

The agent is behaving correctly — the outbound message contains exactly one MEDIA: directive (verified in the session *.jsonl). The duplication happens entirely in the delivery pipeline, and only for non-image media.

Root Cause

Likely the same dual-path reply-media normalization described in #68056 — media flows through both the block-reply path (onBlockReply / sendDirectBlockReply) and the final normalizeReplyPayloadMedia, whose persistedMediaBySource caches are not shared, so the same source is persisted/sent twice. The WhatsApp fix (#68111) does not appear to cover the zalouser document path. Images are unaffected because they take a single inline/render path.

Code Example

Here is the file:

   MEDIA:/root/.openclaw/workspace-5am/finance/quy-nhom-5am.xlsx
RAW_BUFFERClick to expand / collapse

Summary

On the Zalo personal (zalouser) channel, when an assistant reply contains a single MEDIA: directive pointing to a document (e.g. .xlsx), the file is delivered twice as two separate attachment messages in the same turn. Images sent the same way appear only once.

The agent is behaving correctly — the outbound message contains exactly one MEDIA: directive (verified in the session *.jsonl). The duplication happens entirely in the delivery pipeline, and only for non-image media.

Environment

  • OpenClaw 2026.5.19 (native systemd, built from source)
  • Channel: zalouser (zca-js), group chat
  • Node 22

Reproduction

  1. Have an agent on the zalouser channel produce a reply whose text ends with a single directive, e.g.:
    Here is the file:
    
    MEDIA:/root/.openclaw/workspace-5am/finance/quy-nhom-5am.xlsx
  2. Observe the Zalo chat: the .xlsx is delivered as two identical file messages (file → text → file in one turn).
  3. Repeat with an image path (.png/.jpg) → delivered once (correct).

What I verified

  • The session transcript shows exactly one MEDIA: token in the final assistant message (not two, no separate send tool call). So this is not the model re-echoing the path.
  • Setting agents.defaults.blockStreamingDefault: "off" did not help — documents are still doubled. (channels.zalouser rejects a per-channel blockStreaming key: "must NOT have additional properties".)

Hypothesis

Likely the same dual-path reply-media normalization described in #68056 — media flows through both the block-reply path (onBlockReply / sendDirectBlockReply) and the final normalizeReplyPayloadMedia, whose persistedMediaBySource caches are not shared, so the same source is persisted/sent twice. The WhatsApp fix (#68111) does not appear to cover the zalouser document path. Images are unaffected because they take a single inline/render path.

Expected

A single MEDIA: directive should produce exactly one delivered attachment on zalouser, for documents as well as images.

Related

#68056, #68111, #17991, #42681

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

openclaw - 💡(How to fix) Fix [Bug]: Zalo (zalouser) delivers document media twice for a single MEDIA: directive (images unaffected)