openclaw - 💡(How to fix) Fix Telegram channel fails to initialize after gateway restart (regression in 2026.3.23-2) [3 comments, 4 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#53721Fetched 2026-04-08 01:24:25
View on GitHub
Comments
3
Participants
4
Timeline
5
Reactions
2
Timeline (top)
commented ×3labeled ×2

Telegram channel fails to initialize after any gateway restart — no inbound messages received, outbound via API works

Root Cause

After any gateway restart, the Telegram channel is absent from openclaw channels status --probe. No grammY initialization logs appear. The bot token is valid and outbound messages send successfully, but inbound messages are never received because the long-poll connection is never established. A machine restart (cold boot) correctly initializes all Telegram accounts.

Fix Action

Fix / Workaround

  1. Gateway is running with Telegram channel active and working
  2. Any gateway restart occurs (SIGUSR1, SIGTERM, openclaw gateway restart, or config patch triggering hot-reload)
  3. Gateway restarts and becomes reachable via Control UI / webchat
  4. Telegram channel is not present in openclaw channels status --probe
  5. No "starting provider" or "restarting telegram" log entry appears after restart
  6. Inbound messages from allowed senders are silently dropped
  7. Note: Outbound messages via message tool succeed (Telegram Bot API is reachable)

Affected: All Telegram users with bot accounts on OpenClaw 2026.3.23-2 Severity: High — completely blocks the primary communication channel; no inbound Telegram messages reach any agent Frequency: 100% — reproducible on every gateway restart regardless of trigger method Consequence: Telegram bot becomes send-only. All cron jobs that depend on Telegram delivery fail. Users cannot interact with agents via Telegram after any restart. Workaround: machine restart restores function but is disruptive.

Workarounds attempted (all failed):

  • openclaw gateway restart: Telegram still absent after restart
  • launchctl bootout + restart: Same result
  • openclaw channels remove + add: Config updates but triggers deferred restart that never fires
  • gateway config.patch with enabled false/true: Same deferred restart issue
  • Machine restart: Telegram initializes correctly — this is the only working approach
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

Telegram channel fails to initialize after any gateway restart — no inbound messages received, outbound via API works

Steps to reproduce

  1. Gateway is running with Telegram channel active and working
  2. Any gateway restart occurs (SIGUSR1, SIGTERM, openclaw gateway restart, or config patch triggering hot-reload)
  3. Gateway restarts and becomes reachable via Control UI / webchat
  4. Telegram channel is not present in openclaw channels status --probe
  5. No "starting provider" or "restarting telegram" log entry appears after restart
  6. Inbound messages from allowed senders are silently dropped
  7. Note: Outbound messages via message tool succeed (Telegram Bot API is reachable)

Expected behavior

Telegram channel should automatically re-initialize after gateway restart, just as it does on a clean machine boot. All 4 bot accounts (default, content-agent, book-framework-agent, flairecoin) should reconnect and resume long-polling for inbound messages.

Actual behavior

After any gateway restart, the Telegram channel is absent from openclaw channels status --probe. No grammY initialization logs appear. The bot token is valid and outbound messages send successfully, but inbound messages are never received because the long-poll connection is never established. A machine restart (cold boot) correctly initializes all Telegram accounts.

OpenClaw version

2026.3.23-2 (7ffe7e4)

Operating system

macOS 26.3.1 (Darwin 25.3.0, arm64)

Install method

pnpm

Model

ollama/minimax-m2.7:cloud

Provider / routing chain

openclaw -> ollama -> minimax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: All Telegram users with bot accounts on OpenClaw 2026.3.23-2 Severity: High — completely blocks the primary communication channel; no inbound Telegram messages reach any agent Frequency: 100% — reproducible on every gateway restart regardless of trigger method Consequence: Telegram bot becomes send-only. All cron jobs that depend on Telegram delivery fail. Users cannot interact with agents via Telegram after any restart. Workaround: machine restart restores function but is disruptive.

Additional information

Workarounds attempted (all failed):

  • openclaw gateway restart: Telegram still absent after restart
  • launchctl bootout + restart: Same result
  • openclaw channels remove + add: Config updates but triggers deferred restart that never fires
  • gateway config.patch with enabled false/true: Same deferred restart issue
  • Machine restart: Telegram initializes correctly — this is the only working approach

Root cause hypothesis: The grammY Telegram bot provider does not re-initialize on SIGUSR1 hot-reload. The deferred restart mechanism appears broken — config changes keep resetting an operation counter (2 operations) that never reaches zero, so restart is perpetually deferred.

Logs from working startup (cold boot): [gateway/channels/telegram] [default] starting provider (@Neofxknightbot) Logs after any restart: Zero Telegram-related entries — channel silently skipped

extent analysis

Fix Plan

To resolve the issue with the Telegram channel not initializing after a gateway restart, we need to modify the restart mechanism to properly re-initialize the grammY Telegram bot provider. Here are the steps:

  • Modify the restart handler: Update the code to handle SIGUSR1 and SIGTERM signals to properly restart the Telegram channel.
  • Fix the deferred restart mechanism: Resolve the issue with the operation counter that prevents the restart from being triggered.
  • Add logging for debugging: Include logs to track the restart process and identify any potential issues.

Example code changes:

// Update the restart handler to re-initialize the Telegram channel
process.on('SIGUSR1', async () => {
  // ...
  await telegramChannel.restart();
  // ...
});

process.on('SIGTERM', async () => {
  // ...
  await telegramChannel.restart();
  // ...
});

// Fix the deferred restart mechanism
let operationCounter = 0;
async function restartGateway() {
  // ...
  operationCounter = 0; // Reset the counter
  // ...
}

// Add logging for debugging
logger.info('Restarting Telegram channel...');
await telegramChannel.restart();
logger.info('Telegram channel restarted.');

Verification

To verify that the fix worked:

  1. Restart the gateway using SIGUSR1 or SIGTERM.
  2. Check the logs for the "starting provider" and "restarting telegram" entries.
  3. Use the openclaw channels status --probe command to verify that the Telegram channel is present.
  4. Test inbound and outbound messages to ensure the channel is working correctly.

Extra Tips

  • Make sure to test the fix thoroughly to ensure it resolves the issue in all scenarios.
  • Consider adding additional logging to track the restart process and identify any potential issues.
  • If the issue persists, try debugging the restart mechanism and the grammY Telegram bot provider to identify the root cause.

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…

FAQ

Expected behavior

Telegram channel should automatically re-initialize after gateway restart, just as it does on a clean machine boot. All 4 bot accounts (default, content-agent, book-framework-agent, flairecoin) should reconnect and resume long-polling for inbound messages.

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 - 💡(How to fix) Fix Telegram channel fails to initialize after gateway restart (regression in 2026.3.23-2) [3 comments, 4 participants]