Skip to content

Telegram 429 rate limit on gateway restart — setMyCommands/deleteMyCommands causes bot lockout #32017

@iAhmadZain

Description

@iAhmadZain

Problem

After upgrading to the latest version (2026.3.1), gateway restarts trigger deleteMyCommands + setMyCommands Telegram API calls on every boot. When the gateway is restarted a few times (e.g., during troubleshooting), this quickly hits Telegram's 429 rate limit with retry-after values of 460-490 seconds.

During the lockout period, the bot becomes completely unresponsive — messages show as "loading" in Telegram with no reply.

Expected Behavior

  • Command sync should be throttled/debounced to avoid rate limits on repeated restarts
  • If command sync fails with 429, the bot should still process incoming messages — command registration is non-critical
  • Consider caching last-synced commands and skipping sync if unchanged

Observed Behavior

  • Every openclaw gateway restart calls deleteMyCommands + setMyCommands
  • After a few restarts, Telegram returns 429 Too Many Requests
  • Bot is fully unresponsive during the lockout (~8 min)
  • No messages are processed or replied to

Logs

telegram deleteMyCommands failed: Call to 'deleteMyCommands' failed! (429: Too Many Requests: retry after 491)
telegram setMyCommands failed: Call to 'setMyCommands' failed! (429: Too Many Requests: retry after 490)
Telegram command sync failed: GrammyError: Call to 'setMyCommands' failed! (429: Too Many Requests: retry after 490)

Environment

  • OpenClaw: 2026.3.1
  • Node: v22.22.0
  • OS: macOS (Homebrew)
  • Channel: Telegram
  • Multiple agents on single gateway

Suggested Fix

  1. Cache command hash, skip sync when unchanged
  2. Decouple command sync failure from message polling
  3. Add backoff for command sync retries

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions