Skip to content

fix(discord): avoid blocking startup on probe#77129

Merged
steipete merged 6 commits intomainfrom
fix/discord-async-startup-probe
May 4, 2026
Merged

fix(discord): avoid blocking startup on probe#77129
steipete merged 6 commits intomainfrom
fix/discord-async-startup-probe

Conversation

@steipete
Copy link
Copy Markdown
Contributor

@steipete steipete commented May 4, 2026

Summary

  • Make Discord startup fire the bot/application probe asynchronously so /users/@me timeouts do not block monitor startup.
  • Keep probe-based status enrichment and Message Content Intent warnings when the probe later completes.
  • Add a regression test proving monitor startup proceeds while the startup probe is still pending.

Fixes #77103.

Verification

  • pnpm exec oxfmt --check --threads=1 extensions/discord/src/channel.ts extensions/discord/src/channel.test.ts
  • pnpm test extensions/discord/src/channel.test.ts
  • pnpm check:changelog-attributions
  • git diff --check origin/main...HEAD

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S maintainer Maintainer-authored PR labels May 4, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 4, 2026

Codex review: needs maintainer review before merge.

Summary
The PR makes Discord startup probing asynchronous, preserves later status enrichment, adds regression tests and a changelog entry, and adjusts plugin loader SDK-alias handling for native JS loads.

Reproducibility: yes. Source inspection on current main shows Discord startup awaits the 2.5s /users/@me probe before starting monitorDiscordProvider, matching the related WSL2 timeout report even though I did not live-test WSL2.

Next step before merge
No automated repair candidate: the latest head has no discrete actionable defect from this read-only review; normal PR review and the remaining CI check are the next gates.

Security
Cleared: The diff touches plugin loading but adds no new dependency source, workflow permission, secret handling, download path, or package lifecycle hook.

Review details

Best possible solution:

Land the asynchronous Discord startup probe and SDK-alias loader preservation after the remaining exact-head check completes and maintainer review is satisfied.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection on current main shows Discord startup awaits the 2.5s /users/@me probe before starting monitorDiscordProvider, matching the related WSL2 timeout report even though I did not live-test WSL2.

Is this the best way to solve the issue?

Yes, with validation still pending. Moving only the enrichment probe off the startup path is the narrow maintainable fix for the reported startup blocking, and the latest loader alias change appears targeted at preserving existing plugin load contracts.

What I checked:

  • Current main blocks before monitor startup: Discord startAccount awaits probeDiscord(token, 2500, { includeApplication: true }) before calling monitorDiscordProvider, so a slow /users/@me probe can delay channel startup. (extensions/discord/src/channel.ts:556, 86fc9e3279d1)
  • Probe uses the reported REST path: probeDiscord calls fetchWithTimeout for ${DISCORD_API_BASE}/users/@me with the caller-supplied timeout. (extensions/discord/src/probe.ts:145, 86fc9e3279d1)
  • PR moves probe off the critical path: The PR adds startDiscordStartupProbe and calls it without awaiting before monitorDiscordProvider, while still setting bot/application status when the probe resolves. (extensions/discord/src/channel.ts:82, 66a28696bf2c)
  • Regression coverage added: The PR adds a test where the startup probe promise remains pending while monitorDiscordProvider is still called, then verifies later status enrichment after the probe resolves. (extensions/discord/src/channel.test.ts:423, 66a28696bf2c)
  • Loader alias follow-up present: The latest PR head adds SDK import detection in plugin-module-loader-cache.ts so JS targets importing openclaw/plugin-sdk can route through the source-transform alias path instead of native require. (src/plugins/plugin-module-loader-cache.ts:48, 66a28696bf2c)
  • Exact-head check status: At the latest read-only status query, check-runs for head 66a2869 showed 81 successful, 1 neutral, 17 skipped, and 1 still in progress on the first page; page 2 had no blocking failure output. (66a28696bf2c)

Likely related people:

  • steipete: Current-main blame/log show Peter Steinberger on the Discord startup path and the recent native plugin-loader fast path that this PR adjusts; GitHub commit metadata maps those commits to steipete. (role: recent Discord and plugin-loader maintainer; confidence: high; commits: 1a573d33bc78, 705bde459471, e420592bdfd9; files: extensions/discord/src/channel.ts, extensions/discord/src/probe.ts, src/plugins/plugin-module-loader-cache.ts)
  • scoootscooob: Commit 5682ec37fada moved the Discord implementation into extensions/discord/src, so this is relevant background ownership for the channel boundary. (role: historical Discord migration owner; confidence: low; commits: 5682ec37fada; files: extensions/discord/src/channel.ts, extensions/discord/src/probe.ts)

Remaining risk / open question:

  • The WSL2/undici timeout behavior from the related report was not live-verified in this read-only review.
  • One exact-head Windows Node test check was still in progress at the latest status query.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 86fc9e3279d1.

Re-review progress:

@steipete steipete force-pushed the fix/discord-async-startup-probe branch from 791ac6b to 5b90807 Compare May 4, 2026 05:53
@steipete steipete force-pushed the fix/discord-async-startup-probe branch from 1436088 to 0f62e75 Compare May 4, 2026 06:11
@steipete steipete merged commit 605e894 into main May 4, 2026
109 checks passed
@steipete steipete deleted the fix/discord-async-startup-probe branch May 4, 2026 06:41
staehle pushed a commit to staehle/openclaw that referenced this pull request May 4, 2026
* fix(discord): avoid blocking startup on probe

* fix(discord): clear degraded probe status

* test(plugin-sdk): isolate jiti loader override

* test(plugin-sdk): fix circular facade fixture path

* fix(plugins): preserve sdk aliases for native loads

* fix(plugins): route sdk alias loads through transform
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
* fix(discord): avoid blocking startup on probe

* fix(discord): clear degraded probe status

* test(plugin-sdk): isolate jiti loader override

* test(plugin-sdk): fix circular facade fixture path

* fix(plugins): preserve sdk aliases for native loads

* fix(plugins): route sdk alias loads through transform
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* fix(discord): avoid blocking startup on probe

* fix(discord): clear degraded probe status

* test(plugin-sdk): isolate jiti loader override

* test(plugin-sdk): fix circular facade fixture path

* fix(plugins): preserve sdk aliases for native loads

* fix(plugins): route sdk alias loads through transform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Discord breaks on OpenClaw ≥ 2026.4.29 (WSL2), OK on 2026.4.23

1 participant