openclaw - ✅(Solved) Fix Telegram: commands.native not registering setMyCommands at startup (2026.4.14) [1 pull requests, 2 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#66682Fetched 2026-04-15 06:24:58
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Timeline (top)
referenced ×3commented ×2closed ×1cross-referenced ×1

On OpenClaw 2026.4.14 (macOS, LaunchAgent, grammY long-polling), commands.native: "auto" (default) and commands.native: true (explicit) both fail to register native Telegram bot commands via setMyCommands at gateway startup.

Error Message

No setMyCommands call is ever attempted. No error, no warning, no log entry about command registration at all. The code path in bot-BwMz6R6-.js that calls bot.api.setMyCommands(retryCommands) is never reached.

Root Cause

On OpenClaw 2026.4.14 (macOS, LaunchAgent, grammY long-polling), commands.native: "auto" (default) and commands.native: true (explicit) both fail to register native Telegram bot commands via setMyCommands at gateway startup.

Fix Action

Workaround

Manually register commands via the Telegram Bot API:

curl -X POST "https://api.telegram.org/bot<TOKEN>/setMyCommands" \
  -H "Content-Type: application/json" \
  -d '{"commands": [{"command": "help", "description": "Show available commands"}, ...]}'

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

curl -X POST "https://api.telegram.org/bot<TOKEN>/setMyCommands" \
  -H "Content-Type: application/json" \
  -d '{"commands": [{"command": "help", "description": "Show available commands"}, ...]}'

---

{
  "channels": {
    "telegram": {
      "commands": {
        "native": true,
        "nativeSkills": true
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Description

On OpenClaw 2026.4.14 (macOS, LaunchAgent, grammY long-polling), commands.native: "auto" (default) and commands.native: true (explicit) both fail to register native Telegram bot commands via setMyCommands at gateway startup.

Steps to Reproduce

  1. Fresh OpenClaw 2026.4.14 install with Telegram channel configured
  2. Start gateway via LaunchAgent
  3. Check logs for setMyCommands — zero attempts logged
  4. Type / in Telegram DM with the bot — no autocomplete menu appears
  5. Explicitly set channels.telegram.commands.native: true in openclaw.json
  6. Restart gateway
  7. Still no setMyCommands attempts in logs

Expected Behavior

Gateway should call setMyCommands on Telegram provider startup, registering built-in commands (help, status, new, reset, model, etc.) and user-invocable skill commands when nativeSkills is enabled.

Actual Behavior

No setMyCommands call is ever attempted. No error, no warning, no log entry about command registration at all. The code path in bot-BwMz6R6-.js that calls bot.api.setMyCommands(retryCommands) is never reached.

Workaround

Manually register commands via the Telegram Bot API:

curl -X POST "https://api.telegram.org/bot<TOKEN>/setMyCommands" \
  -H "Content-Type: application/json" \
  -d '{"commands": [{"command": "help", "description": "Show available commands"}, ...]}'

Environment

  • OpenClaw: 2026.4.14 (323493f)
  • Node: v25.9.0
  • macOS: Darwin 25.4.0 (arm64)
  • Telegram: grammY long-polling mode
  • LaunchAgent: ai.openclaw.gateway

Relevant Config

{
  "channels": {
    "telegram": {
      "commands": {
        "native": true,
        "nativeSkills": true
      }
    }
  }
}

Notes

  • The registration code exists in dist/bot-BwMz6R6-.js (lines referencing setMyCommands, retryCommands, BOT_COMMANDS_TOO_MUCH)
  • The Telegram provider starts successfully and handles messages fine
  • lossless-claw context engine errors were present during some restarts but were resolved — command registration still did not occur after clean restarts with no LCM errors

extent analysis

TL;DR

The issue can be temporarily worked around by manually registering commands via the Telegram Bot API, but a code fix is needed to enable automatic registration.

Guidance

  • Verify that the setMyCommands function is correctly implemented in the bot-BwMz6R6-.js file and that the retryCommands variable is properly defined.
  • Check the code path that calls bot.api.setMyCommands(retryCommands) to ensure it is not skipped due to any conditional statements or errors.
  • Review the openclaw.json configuration file to ensure that the native and nativeSkills properties are correctly set to true.
  • Investigate if there are any errors or warnings in the logs that may indicate why the setMyCommands call is not being attempted.

Example

No code snippet can be provided without modifying the existing codebase, but the manual registration command can be used as a temporary workaround:

curl -X POST "https://api.telegram.org/bot<TOKEN>/setMyCommands" \
  -H "Content-Type: application/json" \
  -d '{"commands": [{"command": "help", "description": "Show available commands"}, ...]}'

Notes

The issue seems to be specific to the OpenClaw 2026.4.14 version and the grammY long-polling mode. The fact that the Telegram provider starts successfully and handles messages fine suggests that the issue is isolated to the command registration process.

Recommendation

Apply the workaround by manually registering commands via the Telegram Bot API until a code fix is available. This will ensure that the bot's commands are registered and functional, even if the automatic registration process is not working.

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

openclaw - ✅(Solved) Fix Telegram: commands.native not registering setMyCommands at startup (2026.4.14) [1 pull requests, 2 comments, 2 participants]