Skip to content

Discord: Duplicate messages being sent (double send) #3549

@znznzna

Description

@znznzna

Summary

Messages are being sent twice to Discord channels, resulting in duplicate messages with the same content appearing approximately 0.3-1 seconds apart.

Environment

  • Clawdbot version: 2026.1.24-3
  • Platform: Ubuntu (VPS)
  • Discord channel: Using GLM-4.7 (z.ai) as the model
  • Node.js: 22.22.0

Reproduction

  1. Send any message to an Elma agent in a Discord channel
  2. Observe that the response is sent twice with different message IDs

Evidence from Discord API

Messages retrieved via Discord API show duplicate sends:

ID:1466146796693749955 - timestamp: 2026-01-28T19:03:56.022
ID:1466146794655449260 - timestamp: 2026-01-28T19:03:55.536 (same content!)

ID:1466146772618317857 - timestamp: 2026-01-28T19:03:50.282
ID:1466146771460821246 - timestamp: 2026-01-28T19:03:50.006 (same content!)

Logs

  • The Clawdbot logs show only ONE embedded run start/end per message
  • However, verbose logging showed the same streaming text being emitted many times with sequential aseq numbers
  • No duplicate lane enqueue entries visible

Attempted fixes

  1. Service restart - did not help
  2. blockStreaming: true in Discord config - caused API to hang completely (no messages sent)

Additional context

  • Discord Gateway connection was also unstable earlier (multiple WebSocket connection closed with code 1005 errors)
  • After fixing the WebSocket issues, duplicate sending persists
  • The issue appears to be in the streaming output processing where the same chunk gets sent to Discord twice

Expected behavior

Each message should be sent only once to Discord.

Actual behavior

Each message is sent twice, approximately 0.3-1 second apart, with different Discord message IDs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    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