Repository navigation
Description
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
On macOS, the Discord gateway plugin (Carbon) silently hangs at client initialized as <id>; awaiting gateway readiness after restart, never reaching READY, with no timeout/error event ever fired. A raw ws connection from the same Node binary, same node_modules/ws, same machine, same bot token completes the WS handshake to gateway.discord.gg in <1 second — proving the failure is purely inside Carbon's Client constructor → registerClient async flow, not the network/token/Discord. Still reproduces on 2026.5.3-1 despite #56492 / #57075 / #58290 / #59820 / #70841 / #63223 having been closed as duplicates over the past two months.
Steps to reproduce
- Install OpenClaw 2026.5.3-1 on macOS via npm global, run as a
~/Library/LaunchAgents/ai.openclaw.gateway.plistLaunchAgent. - Configure a single Discord bot account, single guild, with
commands.native: falseandcommands.nativeSkills: false(rules out the slash-deploy CPU spike from [Bug]: Discord gateway stuck at 'awaiting gateway readiness' — --verbose flag as workaround (v2026.4.2) #60559). launchctl bootout "gui/$(id -u)/ai.openclaw.gateway"→ wait 60s →launchctl bootstrap …tail -f ~/.openclaw/logs/gateway.log | grep '\[discord\]'
Observed (every restart over the past 36+ hours, ~10 attempts):
[discord] [default] starting provider (@K2)
[discord] channels resolved: <guild_id> (guild:K2; aliases:guild:<guild_id>)
[discord] users resolved: <user_id>
[discord] channel users resolved: <user_id>
[discord] client initialized as <bot_id>; awaiting gateway readiness
^^^ silent forever — no further [discord] events
- Smoking-gun isolation test — same machine, same token, same
wslibrary bundled with OpenClaw:
node -e '
const WebSocket = require("/path/to/openclaw/node_modules/ws");
const ws = new WebSocket("wss://gateway.discord.gg/?v=10&encoding=json");
ws.on("open", () => console.log("OPEN"));
ws.on("message", (d) => { console.log("MSG:", d.toString().slice(0, 200)); ws.close(); process.exit(0); });
ws.on("error", (e) => { console.log("ERROR:", e.message); process.exit(2); });
'Output (every time, in <1s):
OPEN: WebSocket opened to Discord
MSG: {"t":null,"s":null,"op":10,"d":{"heartbeat_interval":41250,"_trace":[...]}}
So Discord IS sending HELLO. Carbon's GatewayPlugin just never processes it — the 'open' and 'message' handlers either aren't registered before the frame arrives, or registration completes after the frame is already buffered/dropped. This matches the un-awaited-registerClient race documented in #56492 root-cause.
Expected behavior
After [discord] client initialized as ..., within ~5 seconds:
[discord] logged in to discord as <bot_id> (<username>)
And inbound MESSAGE_CREATE events should be delivered to the agent.
Actual behavior
- No
logged in to discordevent ever logged. (Even when the bot IS sometimes alive — see Gateway becomes zombie after system CA rotation; internal reconnect loop cannot recover; Discord READY log line also missing in 2026.4.5 #63223 Problem B about the missing READY log.) - No 15-second
gateway was not readytimeout fires. (The?? truenullish-default inwaitForGatewayReadyreturnsready=truefrom a hung promise — same as [Bug]: Discord plugin: post-restart gateway wedges at "awaiting gateway readiness" on macOS (no 15s timeout fires) #70841.) - Inbound Discord messages never reach the agent (silently dropped).
- Outbound REST works fine (
curl Authorization: Bot $TOKEN https://discord.com/api/v10/users/@me→ 200). lsof -p <gateway_pid> -i -nshows multiple stacked ESTABLISHED TCP connections from the gateway to Discord IPs — Carbon opens new sockets without closing the wedged ones. Snapshot from this session:node 87471 ... TCP 192.168.1.178:51830->162.159.136.234:https (ESTABLISHED) node 87471 ... TCP 192.168.1.178:54742->162.159.137.232:https (ESTABLISHED)
OpenClaw version
2026.5.3-1
Operating system
macOS 26.3.1 (build 25D771280a, Apple Silicon)
Install method
npm global (npm install -g openclaw), launched by ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Model
anthropic/claude-opus-4-7 (via agentRuntime.id: "claude-cli" subprocess to local Claude Code CLI)
Provider / routing chain
discord ← openclaw-gateway → claude-cli subprocess → claude.ai OAuth (overage disabled at org level, irrelevant to this bug)
Additional provider/model setup details
- Single bot account, single guild, single allowed user
commands.native: falseandcommands.nativeSkills: false(eliminates [Bug]: Discord gateway stuck at 'awaiting gateway readiness' — --verbose flag as workaround (v2026.4.2) #60559 slash-deploy contribution to event-loop blocking)agentRuntime.fallback: "none"(eliminates API fallback masking the real error)- Plist
EnvironmentVariables.NSAppSleepDisabled: YES,ProcessType: Interactive(rules out App Nap throttling per Apple TN3433) - 3 plugins loaded: anthropic, discord, memory-core
- Carbon library:
@buape/carbon(bundled in openclaw dist; couldn't easily extract version because plugin runtime deps are now externalized to@openclaw/discordper 2026.5.2 ships sidecar manifest expecting dist/extensions/discord/* but those files are missing from the bundle #76405 / 2026.4.27 → 2026.5.2 silently drops built-in channel extensions (whatsapp, discord, bluebubbles, ...) — built-in→external @openclaw/* migration without auto-install or warning #77483)
Logs, screenshots, and evidence
2026-05-04T20:09:42.638-07:00 [discord] users resolved: <user_id>
2026-05-04T20:09:42.639-07:00 [discord] channel users resolved: <user_id>
2026-05-04T20:09:43.106-07:00 [discord] client initialized as <bot_id>; awaiting gateway readiness
[silence — no further discord events for 30+ minutes]
2026-05-04T20:12:20.690-07:00 [gateway] http server listening (3 plugins: anthropic, discord, memory-core; 3.8s)
2026-05-04T20:12:22.636-07:00 [discord] [default] starting provider (@K2)
2026-05-04T20:12:23.497-07:00 [discord] channels resolved: <guild_id>
2026-05-04T20:12:23.672-07:00 [discord] client initialized as <bot_id>; awaiting gateway readiness
[silence — same hang on second bootout/bootstrap cycle]
Last successful login over the past 36 hours: 2026-05-03 09:57:36 (one success across ~10 restart attempts on this host).
Discord session_start_limit on the affected bot at the time of writing: remaining: 960/1000, resets in 588 min — confirming Discord-side identify quota is not the cause.
Impact and severity
- Affected: any single-bot Discord deployment on macOS launchd (this report); per [Bug]: Discord plugin: post-restart gateway wedges at "awaiting gateway readiness" on macOS (no 15s timeout fires) #70841 the same host saw ~80% failure rate on 4.21
- Severity: High — Discord channel becomes silently non-functional. Outbound REST still works so the bot appears "online" to humans, but inbound messages are dropped without any user-facing error
- Frequency: ~90% of restarts on this host across 36+ hours
- Consequence: End users perceive the bot as ignoring messages. No log signal that anything is wrong (no error, no timeout). Watchdogs that grep for "logged in to discord" misfire because that line was suppressed in 2026.4.5 (per Gateway becomes zombie after system CA rotation; internal reconnect loop cannot recover; Discord READY log line also missing in 2026.4.5 #63223 Problem B), so even healthy boots can no longer be distinguished from wedged ones via logs alone.
Additional information
Regression timeline (all closed as duplicates of root-cause issue #56492 which itself is closed):
- Last known good: pre-2026.3.22 (first carbon-based release)
- v2026.3.22+: hang reported by multiple users (Discord: multi-account gateway startup hangs at 'awaiting gateway readiness' after Carbon reconcile change (v2026.3.22) #53132, Discord gateway hangs at 'awaiting gateway readiness' on single-account setup (v2026.3.22–v2026.3.28) #57075, Discord bot never reaches ready state — stuck at awaiting gateway readiness (v2026.3.28) #58290)
- v2026.4.1: still hanging ([Bug]: [v2026.4.1] Discord provider hangs on first startup, requires health-monitor restart to connect #59820)
- v2026.4.2:
--verboseflag found to be a workaround due to event-loop scheduling side-effect ([Bug]: Discord gateway stuck at 'awaiting gateway readiness' — --verbose flag as workaround (v2026.4.2) #60559) - v2026.4.5: missing READY log line introduced (Gateway becomes zombie after system CA rotation; internal reconnect loop cannot recover; Discord READY log line also missing in 2026.4.5 #63223 Problem B) making the bug invisible to log-based monitoring
- v2026.4.21: ~80% failure rate on macOS confirmed ([Bug]: Discord plugin: post-restart gateway wedges at "awaiting gateway readiness" on macOS (no 15s timeout fires) #70841)
- v2026.5.3-1 (this report): still reproduces with same symptoms, same root-cause behavior
Workarounds that work some of the time:
launchctl bootout+ 60s drain +launchctl bootstrap(≈10–50% success on this host)- Full Mac reboot (≈90% success per anecdotal reports in closed issues; not yet verified on this host)
--verboseflag ([Bug]: Discord gateway stuck at 'awaiting gateway readiness' — --verbose flag as workaround (v2026.4.2) #60559 — appears to side-step the race via additional event-loop microtasks; cannot be set on macOS launchd plists without rewritingProgramArguments)
Workarounds that do NOT work on 2026.5.3-1:
kill -9 $GATEWAY_PIDfollowed by launchd respawnlaunchctl kickstart -k(leaves stale TCP sockets attached)openclaw doctor --fix(does not touch the discord plugin lifecycle)
Suggested fix priority order:
- Make
Client.registerClient(plugin)async-aware in@buape/carbonso the constructor's plugin loop awaits the promise. Per Discord gateway never connects: Carbon Client constructor doesn't await async GatewayPlugin.registerClient #56492 the constructor currently doesfor (const p of plugins) { p.registerClient?.(this); }with no await. This is the upstream fix. - In OpenClaw's discord provider, after
new Client(...), explicitlyawait client.getPlugin('gateway')?.registerClient?.(client)so the WebSocket connection is guaranteed to be established beforelifecycleGateway.isConnectedis polled. This is the OpenClaw-side fix that doesn't require waiting on Carbon upstream. - Restore the
[discord] logged in to discord as ...log line even when the underlying event flow has been refactored. Watchdogs and operators rely on this for liveness. Currently it is silently dropped per Gateway becomes zombie after system CA rotation; internal reconnect loop cannot recover; Discord READY log line also missing in 2026.4.5 #63223. - Replace the
?? truenullish-default in thewaitForGatewayReadyguard with?? false(or surface the actual hung-promise state) so the documented 15-second timeout actually fires. Per [Bug]: Discord plugin: post-restart gateway wedges at "awaiting gateway readiness" on macOS (no 15s timeout fires) #70841 this is currently masking the failure.
I am happy to test patches on this affected macOS host — the bug reproduces deterministically here.
Cross-references: #56492 (root cause, closed dup) · #57075 (single-account, closed dup) · #58290 (closed dup) · #59820 (closed dup) · #70841 (closed dup, macOS, ~80% rate) · #63223 (open, missing READY log) · #60559 (closed, --verbose workaround)
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 5, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open: this is a fresh shipped Discord regression with concrete macOS reproduction, and current main has adjacent post-release readiness/DNS hardening but not enough proof that it resolves this reporter's Carbon/internal client lifecycle hang.
Reproducibility: no. high-confidence current-main reproduction is available. The issue provides strong shipped-package macOS steps for v2026.5.3-1, but this review could only inspect current main and related fixes, not run a live Discord gateway on the affected host.
Next step
This needs maintainer coordination or live macOS validation of the post-release Discord gateway fixes before a safe repair branch can be scoped.
Review details
Best possible solution:
Keep this live regression open until the post-v2026.5.3 fixes are tested on the affected macOS setup; if it still hangs, land a narrow Discord gateway lifecycle fix and leave the READY log-line work to #63223.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main reproduction is available. The issue provides strong shipped-package macOS steps for v2026.5.3-1, but this review could only inspect current main and related fixes, not run a live Discord gateway on the affected host.
Is this the best way to solve the issue?
Unclear. Current main has plausible post-release fixes in READY retry/backoff and Discord IPv4-first transport, but this report distinguishes itself from the earlier identify-race and network cases, so the best path is maintainer/live validation before closing.
Acceptance criteria:
What I checked:
createDiscordMonitorClientwaits forwaitForDiscordGatewayPluginRegistration(gateway)before creating the gateway supervisor, so the current source has the async-registration guard that earlier reports requested. (extensions/discord/src/monitor/provider.startup.ts:165, b546aa91e19b)super.registerClientif a socket has already started. (extensions/discord/src/monitor/gateway-plugin.ts:120, 5adf9d261944)extensions/discord/src/monitor/provider.lifecycle.ts:367, e259938e9643)readyon 2026.5.2 and 2026.5.3 — inboundmessageCreateevents never dispatch #77526 and Discord channel inbound broken on IPv4-only networks (2026.5.x): undici "happy eyeballs" never falls back from failing AAAA lookup #77398 against that fix, but this issue's raw WebSocket evidence suggests a possibly different failure mode. (extensions/discord/src/network-config.ts:35, c3c7c2df6f62)runDiscordGatewayLifecyclewaits for READY. (extensions/discord/src/monitor/provider.ts:572, b546aa91e19b)Likely related people:
extensions/discord/src/monitor/gateway-plugin.ts,extensions/discord/src/monitor/provider.lifecycle.ts,extensions/discord/src/internal/gateway.ts)extensions/discord/src/monitor/provider.lifecycle.ts,extensions/discord/src/monitor/provider.lifecycle.test.ts)extensions/discord/src/monitor/gateway-plugin.ts,extensions/discord/src/monitor/gateway-plugin.test.ts)Remaining risk / open question:
wssuccess and REST success point away from the IPv4/DNS failure fixed for Discord channel inbound broken on IPv4-only networks (2026.5.x): undici "happy eyeballs" never falls back from failing AAAA lookup #77398/Discord channel: gateway WebSocket never reachesreadyon 2026.5.2 and 2026.5.3 — inboundmessageCreateevents never dispatch #77526, so closing solely on that adjacent fix would be premature.Codex review notes: model gpt-5.5, reasoning high; reviewed against b546aa91e19b.
RyanSandoval commentedon May 5, 2026
Follow-up requested by maintainer: the closing note on #56492 explicitly invited fresh issues if the bug recurs after fix commit
5adf9d2619449b98b22f98bcd79d0a5051081f45(#68159, merged 2026-04-24).Confirming the fix is in this version's code path: tag chain shows
5adf9d2619→v2026.4.29-beta.4→v2026.5.2→v2026.5.3→ v2026.5.3-1 (the version under test here).So the SafeGatewayPlugin changes from #68159 (early
this.client = clientassignment + skip-super.registerClient-when-ws/isConnecting-set guard) are present and still allow the hang. This is a regression of the fix on macOS, not a missed-fix duplicate.I tried to leave this note on #56492 directly to bump the original thread but the issue is locked, hence consolidating here.
wena369 commentedon May 5, 2026
@clawsweeper fix issue
Please implement the narrow Discord gateway lifecycle fix suggested in this issue. Focus on the missing gateway handle / READY wait path, especially avoiding treating an undefined gateway as ready, and add regression coverage around startup readiness.
wena369 commentedon May 5, 2026
Additional Windows evidence:
I upgraded to OpenClaw 2026.5.4 (325df3e), restarted the gateway, waited 120 seconds, and the issue still reproduces.
Probe:
Latest gateway log shows:
So v2026.5.4 does not resolve the Windows reproduction.
wena369 commentedon May 5, 2026
OpenClaw 2026.5.4 still reproduces on Windows.
Startup is very slow:
Relevant logs:
wena369 commentedon May 5, 2026
Additional test:
I disabled Telegram (
channels.telegram.enabled = false), restarted OpenClaw 2026.5.4, waited 120 seconds, andopenclaw gateway probestill reports:So the Windows reproduction is not caused only by Telegram startup.
wena369 commentedon May 5, 2026
After disabling Telegram,
openclaw gateway status --deep --require-rpcreportsRead probe: okand admin-capable, but Discord still does not post a reply. Discord shows typing/processing, and logs include:So the gateway RPC path recovers, but Discord message processing/reply delivery still appears stuck.
wena369 commentedon May 5, 2026
Still reproduces on OpenClaw 2026.5.4 (325df3e).
After disabling Telegram, gateway deep status can report Read probe: ok / admin-capable, but Discord still does not reply. The log repeatedly shows:
This looks like the Discord gateway heartbeat/READY path is still blocked by event-loop starvation on Windows, not just a generic gateway listener failure.
wena369 commentedon May 5, 2026
After disabling browser and Telegram, gateway deep status reports Read probe: ok / admin-capable. Startup now loads 5 plugins instead of 6-7, but Discord still stops at:
discord client initialized ...; awaiting gateway readiness
The browser symlink warnings disappeared after disabling browser, so that was not the only cause. The remaining issue still appears specific to Discord gateway readiness/heartbeat on Windows.
wena369 commentedon May 5, 2026
Update after narrowing config:
I minimized the gateway to only 2 loaded plugins: discord and memory-core.
openclaw gateway status --deep --require-rpcreportsRead probe: okandCapability: admin-capable, so the local gateway listener/RPC path is healthy.The Discord channel still does not become ready:
discord client initialized ...; awaiting gateway readinessdiscord gateway error: Error: Gateway heartbeat ACK timeoutfetch-timeout ... https://discord.com/api/v10/users/@mechannels.discord.start-accountis activeThis reproduces on Windows with OpenClaw 2026.5.4 (325df3e), even after disabling Telegram, browser, device-pair, phone-control, and talk-voice.
wena369 commentedon May 5, 2026
Additional network check:
From the same Windows host, Discord HTTPS itself is fast and stable:
Invoke-WebRequest https://discord.com/api/v10/gateway:
1: ok 230ms
2-10: ok 46-52ms
So this does not look like general Discord network latency. OpenClaw still logs
fetch-timeoutforhttps://discord.com/api/v10/users/@meandGateway heartbeat ACK timeoutwhile the gateway is minimized to discord + memory-core. This points more toward OpenClaw Discord plugin event-loop starvation / readiness handling than raw network reachability.wena369 commentedon May 5, 2026
Additional token-authenticated Discord REST check:
From the same Windows host and using the same bot token from
channels.discord.token, direct REST calls tohttps://discord.com/api/v10/users/@meare fast and successful:1: ok 415ms
2: ok 240ms
3: ok 245ms
4: ok 266ms
5: ok 279ms
6: ok 251ms
7: ok 259ms
8: ok 324ms
9: ok 236ms
10: ok 254ms
So the bot token and Discord REST reachability are OK outside OpenClaw.
However, OpenClaw still logs:
fetch-timeout ... https://discord.com/api/v10/users/@mediscord client initialized ...; awaiting gateway readinessdiscord gateway error: Error: Gateway heartbeat ACK timeoutchannels.discord.start-accountis activeThis reproduces on Windows with OpenClaw 2026.5.4 (325df3e), minimized to only discord + memory-core. This strongly suggests the timeout is caused inside the OpenClaw process, not by network latency or an invalid token.
wena369 commentedon May 5, 2026
I found a likely heartbeat lifecycle bug. The first Discord heartbeat is randomized, but ACK timeout checking is driven by a fixed interval started at HELLO time. If the randomized first heartbeat fires late in the interval, the next fixed interval can check
lastHeartbeatAckonly a short time after that heartbeat was sent, causing a falseGateway heartbeat ACK timeout, especially when the event loop is delayed on Windows.I attached a patch that changes the heartbeat timer to schedule the ACK check one full interval after each heartbeat send, with a regression test.
mfbergmann commentedon May 5, 2026
Confirming Linux repro on OpenClaw 2026.5.4 (325df3e), Linux 6.8.0-106-generic x86_64, npm global install, systemd-managed user gateway.
Same signature as the macOS/Windows reports above:
```
[discord] [default] starting provider
[discord] channels resolved: <guild_id>
[discord] channel users resolved: <user_id>
[discord] client initialized as <bot_id>; awaiting gateway readiness
[no further [discord] events; no `logged in to discord` ever]
[diagnostic] liveness warning: ... phase=channels.discord.start-account ...
```
`gateway ready` is logged but the startup-phase state machine stays pinned on `channels.discord.start-account`. Inbound MESSAGE_CREATE events never reach the agent (no `agent/embedded` model call follows the bootstrap injection on the matched session). Outbound REST keeps working fine — cron-driven posts deliver normally — matching the inbound/outbound asymmetry @RyanSandoval documented.
Confirming @wena369's narrowing: disabling `channels.telegram.enabled` only shifts the hang. With Telegram off, the same `start-account` lock simply re-pins on Discord:
```
phase=channels.telegram.start-account → (telegram disabled, restart) → phase=channels.discord.start-account
```
So this isn't Telegram-specific; it's the channel `start-account` flow becoming non-progressing under event-loop delay on a busy gateway. Adds Linux to the macOS + Windows repro list — platform-agnostic, as expected for a heartbeat-lifecycle / promise-await race.
(Note: the comment above mentions an attached patch but I don't see an attachment, link, or referenced PR in this thread — happy to test if a diff or PR gets posted.)
holgergruenhagen commentedon May 5, 2026
Adding a Linux reproduction on OpenClaw 2026.5.4. The issue currently lists macOS and Windows reports — Linux reproduces the same hang.
Environment
/usr/lib/node_modules/openclaw)active-memory,browser,codex,discord,flybridge,lossless-claw,memory-coreRepro
Three consecutive restarts today (UTC), all hung at
awaiting gateway readiness:Each one ends with the same final discord log line and then goes completely silent in the discord namespace:
Notable on Linux: no heartbeat ACK timeout
In all three hangs there is no
Gateway heartbeat ACK timeout— the 41-second heartbeat ACK check never fires at all. That suggests the heartbeat lifecycle is never started, which fits the hypothesis in the issue body that the HELLO frame from Discord arrives but Carbon's Client lifecycle never processes it.Network is fine
[discord] [default] Discord bot probe resolved @OpenClawsucceeds on every boot — REST works.ss -tnpduring the hang shows ESTABLISHED connections to162.159.x.x:443(Discord/Cloudflare).curl https://discord.com/api/v10/users/@mewith the same bot token from the same host returns 200.Trigger context for restart #1
Restart #1 was preceded by a UI-initiated bulk operation: I disabled ~25 skills in the OpenClaw control UI in quick succession. Between 16:27:31 and 16:30:08 UTC the gateway log shows ~25 back-to-back
gateway/reloadcycles, one per skill, eachskills snapshot invalidated by config changetaking ~600–1900ms. During and after that we see:This event-loop pressure is a plausible aggravator for restart #1, but restarts #2 and #3 had no comparable storm and still hung the same way. So the race appears to be the real driver — pressure makes it more likely, but a clean boot can hang too.
Resources during the hangs
S(sleeping interruptibly), CPU ~26%, RSS ~690 MBOn the heartbeat-lifecycle patch
The patch posted earlier today scheduling the ACK check one full interval after each heartbeat send addresses the case where the heartbeat lifecycle at least starts. My Linux logs show a path where the lifecycle never starts at all — possibly the same root cause depending on how the registration race resolves. If the registration finally completes late, the heartbeat schedule is exactly where things would otherwise drift out of sync, so the patch may help on this path too.
Thanks for staying on top of this.
wena369 commentedon May 5, 2026
I applied the proposed heartbeat timer patch locally and ran the Discord gateway unit test:
node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-discord.config.ts
with OPENCLAW_VITEST_INCLUDE_FILE=["extensions/discord/src/internal/gateway.test.ts"]
Result:
The patch changes heartbeat ACK checking so the ACK timeout is scheduled one full interval after each heartbeat send, instead of using a fixed interval that can fire shortly after the randomized first heartbeat.
RyanSandoval commentedon May 6, 2026
Update from the original reporter — heartbeat patch tested, does not fix this failure mode.
I hand-applied the heartbeat fix from #77956 (replace
setIntervalwith recursivesetTimeoutinGatewayHeartbeatTimers.start) directly to my installed dist:After also clearing the
~/.openclaw/tmp/jiti/cache to force regeneration, I confirmed the patched code IS being executed (3×scheduleNextreferences in the regenerateddist-provider-Cy1aml6b.2f84d366.mjs).Result: Discord still hangs at
client initialized as <id>; awaiting gateway readinessindefinitely. No login ever fires. After ~15 minutes the WS gets a1006close (Discord's idle timeout) and the cycle repeats with no recovery.This confirms @holgergruenhagen's earlier observation — when the heartbeat lifecycle never starts (no
Gateway heartbeat ACK timeoutevent ever fires), the heartbeat-timer fix is a no-op. The bug is upstream of heartbeats: the IDENTIFY → READY exchange never completes, so heartbeats are never scheduled in the first place.Symptom timeline on this host:
This means #77956 / #78087 (heartbeat fixes) — while still useful for the post-identify-success false-timeout cycle — won't address this issue's primary failure mode on macOS. The needed fix is in the Carbon
Client.registerClientasync path that #56492 / #68159 addressed back in April; that fix landed (commit5adf9d2619) and is in v2026.5.3-1, but the race apparently still fires on this macOS configuration.I'm leaving the heartbeat patch in place locally — it's a no-op for this failure mode but won't hurt and will help once the IDENTIFY race is genuinely fixed.
Happy to test any patch targeting the Carbon registration / Identify race; the bug is 100% reproducible on this host.
wena369 commentedon May 6, 2026
Thanks, that makes sense. I’ll keep my Windows findings scoped as a separate/possibly related failure mode rather than claiming the heartbeat patch fixes the macOS Carbon/IDENTIFY race.
For my host, the strongest signal was gateway event-loop starvation while deferred/missed cron work was active. After disabling/removing those cron jobs, the gateway is currently healthy:
fix: schedule discord heartbeat checks after sends
fix(discord): avoid false heartbeat ACK timeouts
steipete commentedon May 6, 2026
Landed the narrow Discord heartbeat scheduler fix in #78087: b5c33bc
I verified the surviving current-main bug was the ACK timeout race, not the older Carbon
registerClienttheory: the first heartbeat was randomized, but the ACK check was scheduled from timer start, so a late first heartbeat could falsely triggerGateway heartbeat ACK timeoutand reconnect while the channel was still awaiting READY.Keeping this issue open for now. @RyanSandoval, if you can run the promised 5
launchctl bootout+bootstrapcycles on the affected macOS host after updating to a build that includes the landed commit, that would be the best close proof.steipete commentedon May 6, 2026
Reopening for affected-host verification. The fix is landed in #78087 / b5c33bc, but we should keep this open until the macOS launchd restart retest confirms the readiness hang is gone.
steipete commentedon May 6, 2026
Verified fixed on current main by b5c33bc.
That commit changes the Discord Gateway heartbeat scheduler so ACK timeout checks are measured from the actual heartbeat send rather than from the fixed HELLO-time interval, which covers the false reconnect loop behind this report's
awaiting gateway readiness/heartbeat ACK timeout path. It also addedextensions/discord/src/internal/gateway-lifecycle.test.tscoverage and records focused test, formatting, diff, and real-behavior proof in the commit message.Closing as fixed on main. Release pickup still depends on the next published build containing b5c33bc.
fix(discord): avoid false heartbeat ACK timeouts