openclaw - ✅(Solved) Fix [Bug] Telegram setMyCommands not called on gateway restart in 2026.4.14 [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#66714Fetched 2026-04-15 06:24:47
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Participants
Timeline (top)
referenced ×3closed ×1commented ×1cross-referenced ×1

After upgrading to OpenClaw 2026.4.14, the Telegram bot slash commands disappear after a gateway restart. The getMyCommands API returns an empty list, and the bot menu in Telegram is blank.

Error Message

Relevant log entries showing the difference between working and broken restarts can be provided on request. The key indicator is the presence/absence of:

{"subsystem":"gateway/channels/telegram"} Telegram menu text exceeded the conservative 5700-character payload budget; shortening descriptions to keep 58 commands visible.

Root Cause

Root Cause Hypothesis

Fix Action

Workaround

Manually calling setMyCommands via the Bot API restores commands until the next restart. A cron job can be used as a temporary band-aid.

PR fix notes

PR #66730: fix: use process-scoped cache for Telegram command sync

Description (problem / solution / changelog)

Summary

Fix Telegram bot slash commands disappearing after gateway restart.

Root Cause

The command hash cache was persisted to disk across gateway restarts. When the command list had not changed, the cached hash matched and setMyCommands was skipped entirely. However, Telegram bot commands can be cleared by external factors (API changes, bot token refresh, etc.), so the cached state becomes stale after a restart — commands remain empty until the command list actually changes.

Fix

Replaced file-based hash cache with a process-scoped Map. This:

  • Preserves the rapid-restart rate-limit protection within a single process
  • Ensures commands are always re-registered after a gateway restart (Map resets on process exit)
  • Removes unused imports (fs, os, path, resolveStateDir)

Closes openclaw#66714 Closes openclaw#66682

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/telegram/src/bot-native-command-menu.ts (modified, +14/-38)

Code Example

Telegram menu text exceeded the conservative 5700-character payload budget; shortening descriptions to keep 58 commands visible.

---

{"subsystem":"gateway/channels/telegram"} Telegram menu text exceeded the conservative 5700-character payload budget; shortening descriptions to keep 58 commands visible.
RAW_BUFFERClick to expand / collapse

Description

After upgrading to OpenClaw 2026.4.14, the Telegram bot slash commands disappear after a gateway restart. The getMyCommands API returns an empty list, and the bot menu in Telegram is blank.

Environment

  • OpenClaw version: 2026.4.14 (323493f)
  • Platform: Linux 6.8.0-101-generic (x64), Node 22.22.1
  • Channel: Telegram (grammy-based provider)
  • Bot: @larry_the_lobstar_81_bot

Evidence

  1. Working restarts earlier today (15:30–15:52 UTC): Logs show the gateway calling setMyCommands successfully:
Telegram menu text exceeded the conservative 5700-character payload budget; shortening descriptions to keep 58 commands visible.
  1. Broken restarts later today (17:09–17:31 UTC): Gateway restarts show no setMyCommands call at all. The "starting provider" log appears, but the menu registration step is completely skipped.

  2. API verification: getMyCommands returns {"ok":true,"result":[]} after restart, confirming commands were never set.

  3. Workaround: Manually calling setMyCommands via the Telegram Bot API works fine and persists until the next gateway restart.

Root Cause Hypothesis

The registerTelegramNativeCommands function in bot-BwMz6R6-.js is not being called during gateway startup after the 2026.4.14 update. Earlier restarts in the same session did register commands, suggesting a timing or initialization order issue that manifests inconsistently.

Impact

  • All 42–58 native slash commands disappear from the Telegram bot menu
  • Users lose the ability to use the / command menu in Telegram
  • Commands like /help, /status, /model etc. are unavailable via the native menu

Workaround

Manually calling setMyCommands via the Bot API restores commands until the next restart. A cron job can be used as a temporary band-aid.

Logs

Relevant log entries showing the difference between working and broken restarts can be provided on request. The key indicator is the presence/absence of:

{"subsystem":"gateway/channels/telegram"} Telegram menu text exceeded the conservative 5700-character payload budget; shortening descriptions to keep 58 commands visible.

extent analysis

TL;DR

The most likely fix is to investigate and resolve the issue with the registerTelegramNativeCommands function not being called during gateway startup after the OpenClaw 2026.4.14 update.

Guidance

  • Verify that the registerTelegramNativeCommands function is being called correctly during gateway startup by checking the logs for the presence of the "Telegram menu text exceeded the conservative 5700-character payload budget" message.
  • Investigate the initialization order and timing of the gateway startup process to identify any potential issues that may be causing the registerTelegramNativeCommands function to be skipped.
  • Consider adding logging or debugging statements to the registerTelegramNativeCommands function to gain more insight into why it is not being called.
  • As a temporary workaround, implement a cron job to manually call setMyCommands via the Telegram Bot API to restore commands until a permanent fix can be implemented.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The root cause of the issue is likely related to the registerTelegramNativeCommands function not being called during gateway startup, but the exact cause is still uncertain and requires further investigation.

Recommendation

Apply the workaround by implementing a cron job to manually call setMyCommands via the Telegram Bot API, as a permanent fix is not yet available and this will restore functionality until the underlying issue can be resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING