Description
When running multiple Telegram bot accounts under a single OpenClaw gateway instance, frequent 409 Conflict errors occur on getUpdates calls, causing a restart loop.
Environment
- OpenClaw version: 2026.3.8
- OS: macOS (Darwin, arm64)
- Node: v24.x
- Telegram accounts: 4 bot tokens configured under one gateway
Steps to Reproduce
- Configure 2+ Telegram bot accounts in
openclaw.yaml
- Start the gateway (
openclaw gateway start)
- Observe logs —
409 Conflict errors appear on getUpdates within minutes
Observed Behavior
- With 1 account active: no 409 errors ✅
- With 2+ accounts active: 409 errors begin ❌
- The health monitor detects "stale socket" (no events for N minutes) → triggers restart → new pollers spawn before old pollers are fully torn down → duplicate
getUpdates calls → Telegram returns 409
- This creates a restart loop: 409 → health check restart → 409 → ...
- In our case, we observed 160+ restarts/day before disabling the health monitor
Investigation Details
We performed isolation testing:
- Verified only 1 OS process is running (
ps aux)
- Confirmed no webhooks are set (
getWebhookInfo clean for all 4 accounts)
- LaunchAgent confirmed not running (no duplicate process)
- Individual
curl getUpdates per token works fine when gateway is stopped
- Root cause appears to be: during
SIGUSR1 hot-reload (or health-check-triggered restart), previous pollers are not fully cleaned up before new pollers are spawned, creating a race condition where two pollers compete for the same bot token
Current Workaround
Setting channelHealthCheckMinutes: 0 in config disables the health monitor and reduces 409 frequency significantly, but does not fully eliminate the issue during config hot-reloads.
Expected Behavior
- Multiple Telegram bot accounts should coexist without 409 conflicts
- On restart/reload, old pollers should be fully stopped before new ones are created
- Graceful shutdown of polling connections before re-initialization
Suggested Fix
Ensure SIGUSR1 handler (and any restart path) awaits full teardown of existing Telegram pollers (including closing active getUpdates long-poll connections) before initializing new ones. A simple sequence:
- Signal all active pollers to stop
- Await confirmation / force-close after timeout
- Only then create new poller instances
Description
When running multiple Telegram bot accounts under a single OpenClaw gateway instance, frequent
409 Conflicterrors occur ongetUpdatescalls, causing a restart loop.Environment
Steps to Reproduce
openclaw.yamlopenclaw gateway start)409 Conflicterrors appear ongetUpdateswithin minutesObserved Behavior
getUpdatescalls → Telegram returns 409Investigation Details
We performed isolation testing:
ps aux)getWebhookInfoclean for all 4 accounts)curl getUpdatesper token works fine when gateway is stoppedSIGUSR1hot-reload (or health-check-triggered restart), previous pollers are not fully cleaned up before new pollers are spawned, creating a race condition where two pollers compete for the same bot tokenCurrent Workaround
Setting
channelHealthCheckMinutes: 0in config disables the health monitor and reduces 409 frequency significantly, but does not fully eliminate the issue during config hot-reloads.Expected Behavior
Suggested Fix
Ensure
SIGUSR1handler (and any restart path) awaits full teardown of existing Telegram pollers (including closing activegetUpdateslong-poll connections) before initializing new ones. A simple sequence: