openclaw - ✅(Solved) Fix [Bug] webhooks plugin: async register() causes routes to never be registered [1 pull requests, 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#67891Fetched 2026-04-17 08:29:01
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

Error Message

Actual: openclaw doctor shows: WARN webhooks: plugin register returned a promise; async registration is ignored. Routes are silently dropped.

  • No error is thrown; registration silently fails
  1. openclaw doctor # → WARN webhooks: plugin register returned a promise Severity: medium — silently fails, no error thrown, requires doctor to detect.

Root Cause

Root cause (in dist/extensions/webhooks/index.js):

  • webhooks_default = definePluginEntry({ ..., async register(api) { ... } }) — register() is async
  • openclaw's plugin loader calls register() without await: pluginEntry.register(api) → promise is immediately discarded
  • No error is thrown; registration silently fails

Fix Action

Fix / Workaround

Workaround: None (webhooks unusable when register is async).

PR fix notes

PR #67941: fix(plugins): enforce synchronous registration

Description (problem / solution / changelog)

Summary

  • enforce synchronous plugin registration in both runtime and CLI metadata loads
  • move webhooks secret resolution to request auth so registration stays synchronous

Validation

  • pnpm test src/plugins/loader.test.ts -t "rejects async register functions"
  • pnpm test src/plugins/loader.cli-metadata.test.ts -t "rejects async plugin registration when collecting CLI metadata"
  • pnpm test extensions/webhooks/src/config.test.ts extensions/webhooks/index.test.ts extensions/webhooks/src/http.test.ts
  • pnpm tsgo
  • pnpm build

Related

  • #67879
  • #67891
  • #67899
  • #67900
  • #64937
  • #65183
  • Supersedes #64640

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/active-memory/index.test.ts (modified, +30/-31)
  • extensions/comfy/comfy.live.test.ts (modified, +1/-1)
  • extensions/device-pair/index.test.ts (modified, +1/-1)
  • extensions/memory-wiki/cli-metadata.test.ts (modified, +1/-1)
  • extensions/memory-wiki/index.test.ts (modified, +1/-1)
  • extensions/openai/index.test.ts (modified, +1/-1)
  • extensions/phone-control/index.test.ts (modified, +1/-1)
  • extensions/talk-voice/index.test.ts (modified, +1/-1)
  • extensions/thread-ownership/index.test.ts (modified, +4/-4)
  • extensions/voice-call/index.test.ts (modified, +2/-2)
  • extensions/webhooks/index.test.ts (added, +66/-0)
  • extensions/webhooks/index.ts (modified, +42/-40)
  • extensions/webhooks/runtime-api.ts (modified, +1/-0)
  • extensions/webhooks/src/config.test.ts (modified, +26/-25)
  • extensions/webhooks/src/config.ts (modified, +11/-33)
  • extensions/webhooks/src/http.test.ts (modified, +87/-18)
  • extensions/webhooks/src/http.ts (modified, +30/-5)
  • src/context-engine/registry.ts (modified, +10/-0)
  • src/plugins/bundled-capability-runtime.ts (modified, +1/-1)
  • src/plugins/cli-registry-loader.ts (modified, +5/-67)
  • src/plugins/cli.test.ts (modified, +0/-52)
  • src/plugins/loader.cli-metadata.test.ts (modified, +6/-5)
  • src/plugins/loader.test.ts (modified, +122/-0)
  • src/plugins/loader.ts (modified, +170/-11)
  • src/plugins/registry.ts (modified, +49/-2)
  • src/plugins/types.ts (modified, +3/-5)
  • src/test-utils/plugin-registration.ts (modified, +4/-4)
  • test/helpers/media-generation/bundled-provider-builders.ts (modified, +1/-1)
  • test/helpers/plugins/provider-registration.ts (modified, +2/-2)
RAW_BUFFERClick to expand / collapse

Bug: webhooks plugin routes never registered in v2026.4.10+

Expected: routes from plugins.entries.webhooks.routes.* are registered and accessible. Actual: openclaw doctor shows: WARN webhooks: plugin register returned a promise; async registration is ignored. Routes are silently dropped.

Root cause (in dist/extensions/webhooks/index.js):

  • webhooks_default = definePluginEntry({ ..., async register(api) { ... } }) — register() is async
  • openclaw's plugin loader calls register() without await: pluginEntry.register(api) → promise is immediately discarded
  • No error is thrown; registration silently fails

Repro:

  1. Add webhook route config in plugins.entries.webhooks.routes
  2. openclaw gateway restart
  3. openclaw doctor # → WARN webhooks: plugin register returned a promise
  4. HTTP requests to the webhook path → 404 (route never registered)

Fix options:

  1. Make register() sync (move async logic into a gateway_start hook or lazy-init on first request)
  2. Make openclaw's plugin loader await register() — change in plugin-sdk

Severity: medium — silently fails, no error thrown, requires doctor to detect.

Workaround: None (webhooks unusable when register is async).

Version: OpenClaw 2026.4.15 (041266a)

extent analysis

TL;DR

To fix the issue, modify the register() function in webhooks/index.js to be synchronous or update the openclaw plugin loader to await the register() promise.

Guidance

  • Identify the register() function in webhooks/index.js and consider moving async logic into a gateway_start hook or lazy-init on first request to make it synchronous.
  • Alternatively, update the openclaw plugin loader to await the register() promise, which may require a change in the plugin-sdk.
  • Verify the fix by checking the output of openclaw doctor for the absence of the WARN webhooks: plugin register returned a promise warning and ensuring that HTTP requests to the webhook path return a successful response instead of a 404 error.
  • Test the webhooks functionality thoroughly after applying the fix to ensure that routes are correctly registered and accessible.

Example

// Before (async register)
webhooks_default = definePluginEntry({
  // ...
  async register(api) {
    // async logic here
  }
})

// After (sync register with lazy-init)
webhooks_default = definePluginEntry({
  // ...
  register(api) {
    // sync logic here
    // lazy-init on first request
    api.on('request', () => {
      // async logic here
    })
  }
})

Notes

The provided fix options require changes to either the webhooks/index.js file or the openclaw plugin loader. The choice of fix depends on the specific requirements and constraints of the project.

Recommendation

Apply a workaround by making the register() function synchronous, as this is a more localized change that does not require updates to the openclaw plugin loader. This approach allows for a more contained fix with potentially less risk of introducing new issues.

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 - ✅(Solved) Fix [Bug] webhooks plugin: async register() causes routes to never be registered [1 pull requests, 1 participants]