Skip to content

[Bug]: Duplicate message content #88951

Closed as not planned
Closed as not planned

Description

@2973852520

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

OpenClaw responses are duplicated 2–4 times per message.
This problem started after upgrading OpenClaw from 2026.5.4to 2026.5.27, and it still persists in 2026.5.28.

Image Image

Steps to reproduce

  1. Launch OpenClaw 2026.5.28.
  2. Send a message via Matrix or WeChat.
  3. Observe that the reply content is duplicated/repeated.

Expected behavior

In version 2026.5.28, the agent responds to my messages normally.

Actual behavior

The agent's replies are repeated multiple times.

OpenClaw version

2026.5.28

Operating system

Ubuntu 24.04

Install method

npm global

Model

Minimax

Provider / routing chain

OpenClaw -> MiniMax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

14:03:40+08:00 info gateway/channels/openclaw-weixin/e6d42f8b5e92-im-bot [e6d42f8b5e92-im-bot] inbound message: from=o9cq80zMA2TfvdrdD6zIXzqPPBFg@im.wechat types=1
14:03:40+08:00 info gateway/channels/openclaw-weixin inbound: from=o9cq80zMA2TfvdrdD6zIXzqPPBFg@im.wechat to=o9cq80zMA2TfvdrdD6zIXzqPPBFg@im.wechat bodyLen=7 hasMedia=false
14:03:40+08:00 info agents/tool-policy {"subsystem":"agents/tool-policy"} {"rule":"tools.profile (coding)","ruleKind":"allow","removedToolCount":5,"removedTools":["agents_list","gateway","message","nodes","tts"],"removedToolsTruncated":false} tool policy removed 5 tool(s) via tools.profile (coding): agents_list, gateway, message, nodes, tts
14:03:44+08:00 info gateway/channels/openclaw-weixin outbound: to=o9cq80zMA2TfvdrdD6zIXzqPPBFg@im.wechat contextToken=AARzJW…(len=136) textLen=80 mediaUrl=none
14:03:44+08:00 info gateway/channels/openclaw-weixin outbound: text sent OK to=o9cq80zMA2TfvdrdD6zIXzqPPBFg@im.wechat
14:03:44+08:00 info gateway/channels/openclaw-weixin debug-check: accountId=e6d42f8b5e92-im-bot debug=false hasContextToken=true

Impact and severity

Affected: All channels users on 2026.5.28
Severity: Medium
Frequency: 100% reproducible
Consequence: Duplicate bot replies

Additional information

No response

Activity

  1. clawsweeper commented on Jun 1, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

    Close as superseded by the existing duplicate-reply cluster: the central cross-channel repeated-reply problem is already tracked by the open canonical issue with current-main source proof, while this issue's direct-agent and double-ingest details map to narrower open sibling trackers.

    Root-cause cluster
    Relationship: duplicate
    Canonical: #86519
    Summary: This issue is a corroborating duplicate for the shared duplicate-reply regression tracked by the canonical open issue, with narrower strands already represented by adjacent open trackers.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Canonical path: Keep #86519 as the canonical shared duplicate-reply tracker, with #85937 and #72176 preserving the narrower assistant-persistence and inbound double-ingest strands.

    So I’m closing this here and keeping the remaining discussion on #86519, #85937, and #72176.

    Review details

    Best possible solution:

    Keep #86519 as the canonical shared duplicate-reply tracker, with #85937 and #72176 preserving the narrower assistant-persistence and inbound double-ingest strands.

    Do we have a high-confidence way to reproduce the issue?

    Yes, source-level reproduction exists for the central duplicate-reply class through the canonical tracker, including current-main preview/final delivery evidence. I did not run a fresh live Matrix, WeChat, Slack, Discord, or TUI reproduction in this read-only review.

    Is this the best way to solve the issue?

    Yes, closing this satellite as superseded is the best cleanup path because the remaining work is already split across open canonical trackers with stronger current-main evidence. Keeping this issue open would duplicate triage instead of adding a distinct fix boundary.

    Security review:

    Security review: This non-PR issue does not introduce a patch security surface.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • Repository policy read: Root AGENTS.md was read fully and its high-confidence source, history, current/shipped behavior, and related-item review guidance was applied. (AGENTS.md:1, 5e7a0b155808)
    • Vision fit: VISION.md prioritizes bug fixes, stability, model-provider support, and major messaging-channel support, so the underlying duplicate-reply regression fits core tracking even though this satellite can close. (VISION.md:21, 5e7a0b155808)
    • Current issue live state: Live GitHub shows this issue is open, has no closed-by pull request references, and includes later comments isolating agent-harness duplication and Discord double-ingest evidence.
    • Canonical duplicate tracker: Live GitHub shows [Bug]: Agent repeats identical replies 2-10x on Telegram after 5.20 update #86519 is open, P1, source-reproducible, and already treated as the canonical shared preview/final duplicate-reply tracker for cross-channel repeated replies.
    • Current main still has the canonical preview/final gap: Current main drops final payloads only when block streaming succeeded end-to-end via blockReplyPipeline.didStream(), which matches the canonical issue's remaining shared duplicate-delivery contract rather than a fixed state here. (src/auto-reply/reply/agent-runner-payloads.ts:285, 5e7a0b155808)
    • Current test preserves partial-preview finals: A current e2e test still expects final text blocks after partial preview streaming, supporting that the remaining work belongs in the canonical preview/final duplicate tracker. (src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts:817, 5e7a0b155808)

    Likely related people:

    • obviyus: The canonical issue and git history tie the preview/final duplicate-delivery regression to commit b6fd843, which removed preview/final dedupe from the agent-runner surfaces. (role: introduced behavior and recent narrow fix contributor; confidence: high; commits: b6fd843288d7, 27d57af12783, 844d263af0d2; files: src/auto-reply/reply/agent-runner.ts, src/auto-reply/reply/agent-runner-payloads.ts, extensions/telegram/src/lane-delivery-text-deliverer.ts)
    • vincentkoc: Current blame and related duplicate-message reviews show recent work around final payload suppression, delivery mirror dedupe, and inbound dedupe surfaces that maintainers should compare before changing the shared contract. (role: recent adjacent contributor; confidence: medium; commits: 6c82a9fb1866, f5eddc2b6d1f, 4ee50ce18e35; files: src/auto-reply/reply/agent-runner-payloads.ts, src/config/sessions/transcript.ts, src/agents/embedded-agent-subscribe.handlers.messages.ts)
    • Ted Li: The original Matrix/WeChat-oriented report and prior review evidence point to recent outbound route/session delivery work, including commit 6cb06f5, as useful context for any Matrix-specific follow-up. (role: recent Matrix/outbound adjacent contributor; confidence: medium; commits: 6cb06f5fbcf5; files: src/infra/outbound/deliver.ts, src/infra/outbound/delivery-queue-recovery.ts, extensions/matrix/src/matrix/monitor/handler.ts)

    Codex review notes: model internal, reasoning high; reviewed against 5e7a0b155808.

  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jun 1, 2026
  3. 2973852520 commented on Jun 1, 2026

    @2973852520
    Author

    The issue worsened a few hours later, with no changes to the configuration or gateway restart.

    Image
  4. marcobrit0 commented on Jun 1, 2026

    @marcobrit0

    Corroborating data on 2026.5.28 (Ubuntu 24.04, npm global) — and some isolation that suggests this is harness-level, not model- or channel-specific.

    It is not specific to MiniMax or to Matrix/WeChat. I hit the identical symptom with a custom Google provider (api: google-generative-ai, API-key auth) on the Slack channel, and it also reproduces with no channel at all, directly in openclaw agent --json — result.payloads[0].text itself contains the answer repeated N times.

    Decisive isolation — raw provider call is clean, agent harness duplicates:

    # raw provider call — CLEAN, single output
    $ openclaw infer model run --model google/gemini-2.5-flash --prompt "Say hi in one sentence." --json
    # -> outputs[0].text == "Hi, Marco!"
    
    # same model through the agent harness — DUPLICATED
    $ openclaw agent --agent main --model google/gemini-2.5-flash --json --message "Say hi in one short sentence."
    # -> result.payloads[0].text == "<one sentence>" repeated 16x
    

    So the provider/adapter output is fine; the duplication is introduced by the agent harness streamed-text finalization (harness id openclaw), before any channel dispatch. That also means it's upstream of the outbound dedupe described in #85937.

    The duplication tracks the thinking/reasoning stream. With reasoning: false on the provider models:

    Model agent-harness result
    gemini-2.5-flash clean, single
    gemini-2.5-pro duplicated ~4×
    gemini-3.5-flash duplicated ~2–8×

    With reasoning: true, gemini-2.5-flash also duplicates (8–16×) and the thinking trace bleeds into the visible answer. The only clean config is a model whose thinking can be fully disabled (gemini-2.5-flash + reasoning:false); models with non-disablable thinking (2.5-pro, 3.x) keep duplicating. The duplication count tracks the number of stream events, consistent with cumulative streamed chunks being concatenated instead of replaced during finalization.

    Likely the same root cause as #85937 (Gemini native streaming persisting assistant.text twice) — but here it's not masked by outbound dedupe; it reaches payloads[].text and the channel N× (not just 2×).

    Workaround: reasoning: false + gemini-2.5-flash as the default model produces clean output.

  5. 2973852520 commented on Jun 11, 2026

    @2973852520
    Author

    Today, the repetition count hit a staggering 1000+ times, to the point where I can no longer use OpenClaw.

    Image
  6. ladygege commented on Jun 11, 2026

    @ladygege
    Contributor

    今天,重复次数达到了惊人的 1000 多次,以至于我无法再使用 OpenClaw 了。

    我没有复现这个问题,大佬能多提供点信息吗

  7. 2973852520 commented on Jun 12, 2026

    @2973852520
    Author

    今天,重复次数达到了惊人的 1000 多次,以至于我无法再使用 OpenClaw 了。

    我没有复现这个问题,大佬能多提供点信息吗

    你好,我刚才在一个全新的Ubuntu系统通过OpenClaw安装命令安装了最新版,然后直接复现成功,这是复现的截图:

    Image

    我的复现步骤:
    1.运行安装命令 curl -fsSL https://openclaw.ai/install.sh | bash
    2.在配置引导中选择Skip for now,只有最后一步的hooks选择了所有的
    3.修改openclaw.json
    4.重启gateway
    5.执行openclaw tui
    6.发送消息,收到了重复信息

    即使我切换不同供应商的不同模型,依然会消息内容重复
    以下是步骤3对配置文件的改动:

    Image

    附配置文件内容:

    {
      "agents": {
        "defaults": {
          "workspace": "/root/.openclaw/workspace",
          "model": {
            "primary": "jestion/MiniMax-M3"
          },
          "imageModel": {
            "primary": "jestion/MiniMax-M3"
          },
          "models": {
            "deepseek/deepseek-chat": {},
            "minimax/MiniMax-M3": {},
            "bailian/qwen-vl-max": {},
            "bailian/qwen-vl-plus": {},
            "jestion/subscription/Qwen3-14B": {}
          }
        }
      },
      "models": {
        "mode": "merge",
        "providers": {
          "deepseek": {
            "baseUrl": "https://api.deepseek.com/v1",
            "apiKey": "sk-******************************",
            "api": "openai-completions",
            "models": [
              {
                "id": "deepseek-v4-flash",
                "name": "deepseek-v4-flash",
                "reasoning": false,
                "input": [
                  "text"
                ],
                "cost": {
                  "input": 0,
                  "output": 0,
                  "cacheRead": 0,
                  "cacheWrite": 0
                },
                "contextWindow": 200000,
                "maxTokens": 8192,
                "api": "openai-completions"
              },
              {
                "id": "deepseek-reasoner",
                "name": "DeepSeek Reasoner",
                "reasoning": false,
                "input": [
                  "text"
                ],
                "cost": {
                  "input": 0,
                  "output": 0,
                  "cacheRead": 0,
                  "cacheWrite": 0
                },
                "contextWindow": 200000,
                "maxTokens": 8192,
                "api": "openai-completions"
              }
            ]
          },
          "minimax": {
            "baseUrl": "https://api.minimaxi.com/v1",
            "apiKey": "sk-cp-u******************************************************************************LE",
            "api": "openai-completions",
            "timeoutSeconds": 300,
            "models": [
              {
                "id": "MiniMax-M2.7",
                "name": "MiniMax-M2.7",
                "reasoning": false,
                "input": [
                  "text"
                ],
                "cost": {
                  "input": 0,
                  "output": 0,
                  "cacheRead": 0,
                  "cacheWrite": 0
                },
                "contextWindow": 1000000,
                "maxTokens": 8192,
                "api": "openai-completions"
              }
            ]
          },
          "jestion": {
            "baseUrl": "https://*************/v1",
            "apiKey": "sk-****************************************",
            "api": "openai-completions",
            "timeoutSeconds": 300,
            "models": [
              {
                "id": "subscription/Qwen3-14B",
                "name": "subscription/Qwen3-14B",
                "reasoning": false,
                "input": [
                  "text"
                ],
                "cost": {
                  "input": 0,
                  "output": 0,
                  "cacheRead": 0,
                  "cacheWrite": 0
                },
                "contextWindow": 1000000,
                "maxTokens": 8192,
                "api": "openai-completions"
              },
              {
                "id": "MiniMax-M3",
                "name": "MiniMax-M3",
                "reasoning": true,
                "input": [
                  "text",
                  "image"
                ],
                "cost": {
                  "input": 0,
                  "output": 0,
                  "cacheRead": 0,
                  "cacheWrite": 0
                },
                "contextWindow": 1000000,
                "maxTokens": 8192,
                "api": "openai-completions"
              }
            ]
          },
          "bailian": {
            "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
            "apiKey": "sk-*****************************",
            "api": "openai-completions",
            "models": [
              {
                "id": "qwen-vl-max",
                "name": "Qwen VL Max",
                "reasoning": false,
                "input": [
                  "text",
                  "image"
                ],
                "cost": {
                  "input": 0,
                  "output": 0,
                  "cacheRead": 0,
                  "cacheWrite": 0
                },
                "contextWindow": 32000,
                "maxTokens": 6000,
                "api": "openai-completions"
              },
              {
                "id": "qwen-vl-plus",
                "name": "Qwen VL Plus",
                "reasoning": false,
                "input": [
                  "text",
                  "image"
                ],
                "cost": {
                  "input": 0,
                  "output": 0,
                  "cacheRead": 0,
                  "cacheWrite": 0
                },
                "contextWindow": 32000,
                "maxTokens": 6000,
                "api": "openai-completions"
              }
            ]
          }
        }
      },
      "gateway": {
        "mode": "local",
        "auth": {
          "mode": "token",
          "token": "9512fc4710aa60d405fe1f26956e4d0cd6cded9d19b47cea"
        },
        "port": 18789,
        "bind": "loopback",
        "tailscale": {
          "mode": "off",
          "resetOnExit": false
        },
        "controlUi": {
          "allowInsecureAuth": true
        },
        "nodes": {
          "denyCommands": [
            "camera.snap",
            "camera.clip",
            "screen.record",
            "contacts.add",
            "calendar.add",
            "reminders.add",
            "sms.send",
            "sms.search"
          ]
        }
      },
      "session": {
        "dmScope": "per-channel-peer"
      },
      "tools": {
        "profile": "coding"
      },
      "hooks": {
        "internal": {
          "enabled": true,
          "entries": {
            "boot-md": {
              "enabled": true
            },
            "bootstrap-extra-files": {
              "enabled": true
            },
            "command-logger": {
              "enabled": true
            },
            "compaction-notifier": {
              "enabled": true
            },
            "session-memory": {
              "enabled": true
            }
          }
        }
      },
      "wizard": {
        "lastRunAt": "2026-06-12T02:40:10.844Z",
        "lastRunVersion": "2026.6.5",
        "lastRunCommand": "onboard",
        "lastRunMode": "local"
      },
      "meta": {
        "lastTouchedVersion": "2026.6.5",
        "lastTouchedAt": "2026-06-12T02:40:11.064Z"
      }
    }
    
  8. 2973852520 commented on Jun 12, 2026

    @2973852520
    Author

    Update: The message duplication issue does not occur when I use the Anthropic API endpoint. I'm on a MiniMax paid plan.

  9. yousan commented on Jun 15, 2026

    @yousan
    Contributor

    Independent corroboration of this regression on a different channel/backend — adding a clean repro in case it helps narrow the root cause. Possibly the same underlying issue as #72176 (intermittent duplicate delivery across all channels).

    Environment

    • OpenClaw 2026.5.28, npm global, Linux (Node 22).
    • Channel: Discord. Backend: Claude CLI (OAuth/subscription), model claude-opus-4-7.

    Symptom: each inbound message is ingested twice on a single, healthy connection
    For one user message, the agent session transcript contains two user entries with distinct ids ~150–300 ms apart, and for an image message the attachment is downloaded twice to two separate files whose bytes are identical (same md5) — i.e. two real inbound deliveries, not a double-write.

    Ruled out as causes (so it isn't a multi-instance/user misconfig):

    • Only one gateway process (verified via process table + open-file handles on the state dir).
    • No token sharing with the other local instance (different bot app id).
    • One Discord gateway WebSocket connection; the discord provider initializes once; no reconnect occurred between process start and the duplicated message.

    So a single process with a single WS connection is receiving/handling each MESSAGE_CREATE twice.

    Onset correlates with restart churn
    This host was clean for the prior ~month (0% duplicates across hundreds of messages), then jumped to ~70–80% of messages duplicated immediately after a burst of 6 gateway restarts within ~20 minutes (rapid config edits). It has stayed in the duplicating state across subsequent restarts. This lines up with the 2026.5.27 onset reported here and with the historical "duplicate listeners after reconnect/abort" fixes in the changelog — consistent with a listener/inbound-dedup regression that latches on after reconnect/restart churn.

    Extra data point: double-ingest vs visible double-reply
    The duplicate ingest is constant, but a visible double reply only appears when a cli session reset happens mid-turn (in our case reason=auth-profile): when a reset occurs during processing, the two ingested copies run as two independent agent turns → two replies; otherwise they coalesce into a single turn → one reply. That suggests the inbound de-dup isn't keyed on a stable provider message id that survives a mid-turn session reset.

    Happy to provide redacted logs / transcript snippets if useful.

  10. added
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    on Jun 19, 2026
  11. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions