openclaw - 💡(How to fix) Fix Make `DISCORD_GATEWAY_READY_TIMEOUT_MS` configurable (15s too short for multi-account stagger) [1 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#72273Fetched 2026-04-27 05:32:13
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

The Discord ready timeout DISCORD_GATEWAY_READY_TIMEOUT_MS is hardcoded to 15s in the bundle and is not configurable via env var or config schema. On multi-account Discord setups, the staggered provider start (delaying provider startup 70s/80s/90s to reduce Discord startup rate limits) means the 15s global ready check fires before later accounts finish, producing a restart loop:

[discord] gateway was not ready after 15000ms; restarting gateway

Root Cause

Workaround

Local sed patch on the bundle (`15e3 → 9e4`, `3e4 → 12e4`). Has to be reapplied after every `npm update -g openclaw` because the bundle filename hash changes.

Fix Action

Workaround

Local sed patch on the bundle (`15e3 → 9e4`, `3e4 → 12e4`). Has to be reapplied after every `npm update -g openclaw` because the bundle filename hash changes.

Happy to send a PR if a maintainer can confirm the preferred surface (env var vs config schema).

Code Example

[discord] gateway was not ready after 15000ms; restarting gateway

---

const DISCORD_GATEWAY_READY_TIMEOUT_MS = 15e3;
const DISCORD_GATEWAY_RUNTIME_READY_TIMEOUT_MS = 3e4;
RAW_BUFFERClick to expand / collapse

Summary

The Discord ready timeout DISCORD_GATEWAY_READY_TIMEOUT_MS is hardcoded to 15s in the bundle and is not configurable via env var or config schema. On multi-account Discord setups, the staggered provider start (delaying provider startup 70s/80s/90s to reduce Discord startup rate limits) means the 15s global ready check fires before later accounts finish, producing a restart loop:

[discord] gateway was not ready after 15000ms; restarting gateway

Location

extensions/discord/provider-*.js (bundle filename hash changes between releases). On v2026.4.23 this is provider-Bc1Lm79N.js, lines 5896–5897:

const DISCORD_GATEWAY_READY_TIMEOUT_MS = 15e3;
const DISCORD_GATEWAY_RUNTIME_READY_TIMEOUT_MS = 3e4;

I searched the bundle for process.env.DISCORD_*, process.env.*READY_TIMEOUT*, and any config-schema key for these timeouts — there is no override hook today.

Repro

  • 9 Discord agent accounts on a single gateway
  • Default startup; the third+ accounts get delaying provider startup 70s/80s/90s
  • Within 15s the global "not ready after 15000ms; restarting gateway" fires → SIGTERM → restart loop
  • Observed empirically: 244 `gateway] starting…` events in a single day, 161 SIGTERMs, 44 ready timeouts

Versions

  • openclaw `2026.4.23`
  • Node 22, macOS (LaunchAgent)

Request

Make both timeouts configurable. Suggested options:

  1. Env vars — `OPENCLAW_DISCORD_READY_TIMEOUT_MS` and `OPENCLAW_DISCORD_RUNTIME_READY_TIMEOUT_MS`
  2. Config schema — `gateway.discord.readyTimeoutMs` / `gateway.discord.runtimeReadyTimeoutMs`

A reasonable default could be `max(account.startupStaggerMs) + 30s` rather than a fixed 15s.

Workaround

Local sed patch on the bundle (`15e3 → 9e4`, `3e4 → 12e4`). Has to be reapplied after every `npm update -g openclaw` because the bundle filename hash changes.

Happy to send a PR if a maintainer can confirm the preferred surface (env var vs config schema).

extent analysis

TL;DR

Make the Discord gateway ready timeout configurable via environment variables or config schema to prevent restart loops in multi-account setups.

Guidance

  • Consider using environment variables OPENCLAW_DISCORD_READY_TIMEOUT_MS and OPENCLAW_DISCORD_RUNTIME_READY_TIMEOUT_MS to override the hardcoded timeouts.
  • Alternatively, add gateway.discord.readyTimeoutMs and gateway.discord.runtimeReadyTimeoutMs to the config schema for more flexibility.
  • To verify the fix, monitor the gateway logs for the "not ready after" error and check if the restart loop is resolved.
  • A reasonable default value for the timeout could be max(account.startupStaggerMs) + 30s to accommodate staggered provider startups.

Example

// Example config schema addition
const configSchema = {
  // ...
  gateway: {
    discord: {
      readyTimeoutMs: {
        type: 'integer',
        default: 15000,
      },
      runtimeReadyTimeoutMs: {
        type: 'integer',
        default: 30000,
      },
    },
  },
};

Notes

The current workaround using sed patching is not sustainable due to the changing bundle filename hash. A more robust solution is needed to make the timeouts configurable.

Recommendation

Apply a workaround by using environment variables OPENCLAW_DISCORD_READY_TIMEOUT_MS and OPENCLAW_DISCORD_RUNTIME_READY_TIMEOUT_MS until a permanent fix is implemented, as it provides a more flexible and maintainable solution.

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 Make `DISCORD_GATEWAY_READY_TIMEOUT_MS` configurable (15s too short for multi-account stagger) [1 participants]