openclaw - 💡(How to fix) Fix Feature Request: Add startupConcurrency and startupDelayMs for multi-account Telegram channel initialization [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#78173Fetched 2026-05-06 06:16:19
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
closed ×1commented ×1

Code Example

subsystem: fetch-timeout
operation: fetchWithTimeout
url: https://api.telegram.org/bot.../getMe
timeoutMs: 10000
elapsedMs: 149709
timerDelayMs: 139709
eventLoopDelayHint: "timer delayed 139709ms, likely event-loop starvation"

---

{
  "channels": {
    "telegram": {
      "startupConcurrency": 4,
      "startupDelayMs": 1000
    }
  }
}
RAW_BUFFERClick to expand / collapse

Is your feature request related to a problem? Please describe.

When configuring multiple Telegram bot accounts (I have 16), the Gateway experiences severe event loop starvation during startup. All accounts call getMe simultaneously in a Promise.all fashion, which completely saturates the Node.js single-threaded event loop.

Evidence from production logs (16 Telegram bots):

subsystem: fetch-timeout
operation: fetchWithTimeout
url: https://api.telegram.org/bot.../getMe
timeoutMs: 10000
elapsedMs: 149709
timerDelayMs: 139709
eventLoopDelayHint: "timer delayed 139709ms, likely event-loop starvation"
MetricObserved Value
Event Loop Utilization1.0 (100% saturated)
Event Loop Delay P9936,373ms
Event Loop Delay Max149,709ms
CPU Core Ratio0.964
Timers delayed8,000ms - 139,709ms

Describe the solution you'd like

A configuration option to limit concurrency or stagger the startup of multiple Telegram bot accounts. Something like:

{
  "channels": {
    "telegram": {
      "startupConcurrency": 4,
      "startupDelayMs": 1000
    }
  }
}
  • startupConcurrency: Maximum number of accounts to initialize simultaneously (default: unlimited / current behavior)
  • startupDelayMs: Delay between each batch of accounts (default: 0)

This would prevent all getMe probes from hitting the event loop at once, allowing timers to fire on schedule and avoiding cascading fetch timeouts.

Describe alternatives you've considered

AttemptResult
UV_THREADPOOL_SIZE=64No effect - event loop starvation is a main-thread issue, not a thread pool issue
OPENCLAW_FETCH_TIMEOUT=60000Not recognized by the codebase
OPENCLAW_PRICING_FETCH_ENABLED=falseWorks for pricing, but doesn't help Telegram startup
Reducing bot count to ~8Mitigates but doesn't solve the architectural problem

Additional context

  • OpenClaw Version: 2026.5.4 (325df3e)
  • Platform: Windows 11 x64, Node.js 25.9.0
  • Number of Telegram accounts: 16 (each bound to a different agent)
  • Impact: Startup takes 2-3 minutes with dozens of false-positive timeout warnings. Once the event loop recovers, runtime is normal.
  • Relevant log phase: channels.telegram.start-account

This is a quality-of-life improvement for users running multi-agent setups with many Telegram bots. The fix would be a simple p-limit or sequential for loop wrapping the account initialization logic in the channel bootstrap.

extent analysis

TL;DR

Implement a configuration option to limit concurrency or stagger the startup of multiple Telegram bot accounts to prevent event loop starvation.

Guidance

  • Introduce a startupConcurrency option to control the number of accounts initialized simultaneously, defaulting to a reasonable value (e.g., 4).
  • Add a startupDelayMs option to delay each batch of account initializations, allowing the event loop to recover between batches.
  • Consider using a library like p-limit to simplify the implementation of concurrency limiting.
  • Verify the effectiveness of the changes by monitoring event loop utilization and delay metrics.

Example

{
  "channels": {
    "telegram": {
      "startupConcurrency": 4,
      "startupDelayMs": 1000
    }
  }
}

This configuration would limit the number of concurrent account initializations to 4 and introduce a 1-second delay between each batch.

Notes

The proposed solution focuses on mitigating event loop starvation during startup. However, it may not address other potential performance bottlenecks in the system.

Recommendation

Apply a workaround by implementing the proposed configuration options to limit concurrency and stagger startup, as this approach directly addresses the identified root cause of event loop starvation.

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 - 💡(How to fix) Fix Feature Request: Add startupConcurrency and startupDelayMs for multi-account Telegram channel initialization [1 comments, 2 participants]