Skip to content

Discord: Add retry logic for rate-limited messages #392

@NicholasSpisak

Description

@NicholasSpisak

Error: discord block reply failed: Error: You are being rate limited.

Problem:

  • Messages dropped silently when Discord returns 429
  • No retry logic in place

Need:

  • Detect 429 rate limit responses
  • Read retry-after header from Discord
  • Implement exponential backoff

Affected: src/auto-reply/reply/agent-runner.ts (block reply handling), Discord message sending

Workaround: Reduce heartbeat frequency, consolidate responses

Context:
Carbon's RequestClient has queueRequests: true by default, but the rate limit error still propagates up. The onBlockReply callback throws and the error is only logged, not retried:

.catch((err) => {
  logVerbose(`block reply delivery failed: ${String(err)}`);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions