Skip to content

[Matrix] No retry on M_LIMIT_EXCEEDED — message lost permanently #36027

@HanenVit

Description

@HanenVit

Problem

When the Matrix homeserver returns M_LIMIT_EXCEEDED with retry_after_ms, OpenClaw does not retry the send and the message is permanently lost.

Reproduction

  1. Self-hosted Synapse with default rate limiting
  2. Agent processes a long-running request (10+ minutes due to API timeouts/retries)
  3. Agent generates reply and attempts to send
  4. Synapse returns M_LIMIT_EXCEEDED with retry_after_ms: 1120 (1.1 seconds)
  5. OpenClaw logs [matrix] final reply failed: Error: M_LIMIT_EXCEEDED: Too Many Requests and drops the message

Observed logs

2026-03-05T08:56:31.667Z [diagnostic] lane wait exceeded: lane=session:agent:code:matrix:direct:@vitaliy:m.neomentor.tech waitedMs=743990 queueAhead=0
2026-03-05T11:56:36.733+03:00 MatrixHttpClient (REQ-2382) {
  errcode: 'M_LIMIT_EXCEEDED',
  error: 'Too Many Requests',
  retry_after_ms: 1120
}
2026-03-05T08:56:36.746Z [matrix] final reply failed: Error: M_LIMIT_EXCEEDED: Too Many Requests

Expected behavior

When the homeserver returns M_LIMIT_EXCEEDED with retry_after_ms, OpenClaw should wait the specified time and retry (at least once). The retry_after_ms value is typically small (1-2 seconds), so this would not noticeably delay delivery.

Environment

  • OpenClaw: 2026.3.2
  • Matrix plugin: @openclaw/matrix 2026.3.2
  • Homeserver: Synapse (self-hosted)
  • E2EE: enabled

Related

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