Skip to content

Duplicate Discord message delivery on LLM retry after partial delivery #45500

@Assaf-Dagan

Description

@Assaf-Dagan

Bug Report

Version: 2026.3.2
Channel: Discord
Model: anthropic/claude-opus-4-6

What happens

When an Anthropic API call errors out (Internal server error / overloaded) after the agent has already delivered a response to Discord, OpenClaw retries the run. The retry produces a second response that also gets delivered — resulting in the user seeing two different replies to the same message.

Evidence

  • 12 Anthropic API errors in a single session (mix of Internal server error and The AI service is temporarily overloaded)
  • User consistently sees two replies with slightly different wording for the same input
  • Only one active session exists for the channel (confirmed via sessions_list)
  • Single gateway process running
  • No duplicate agent configs

Config context

  • compaction.mode: "safeguard" with reserveTokensFloor: 40000 — safeguard re-runs may also trigger duplicate delivery
  • contextPruning.mode: "cache-ttl" with ttl: "5m"

Expected behavior

If a response has already been delivered to Discord before the error occurs, the retry should detect this and skip re-delivery (or deduplicate).

Workaround

None found — no retry config exposed to users.

Happy to provide full logs if helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions