From fcec2e364dd8dce1fcd95fba2f059a6eb3c5e29a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 2 Mar 2026 19:32:47 +0000 Subject: [PATCH] fix(matrix): keep plugin register sync while bootstrapping crypto runtime (#31989) --- extensions/matrix/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/matrix/index.ts b/extensions/matrix/index.ts index b14ce2771e6..f86706d53f5 100644 --- a/extensions/matrix/index.ts +++ b/extensions/matrix/index.ts @@ -1,5 +1,6 @@ import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import { emptyPluginConfigSchema } from "openclaw/plugin-sdk"; +import { matrixPlugin } from "./src/channel.js"; import { ensureMatrixCryptoRuntime } from "./src/matrix/deps.js"; import { setMatrixRuntime } from "./src/runtime.js"; @@ -8,10 +9,12 @@ const plugin = { name: "Matrix", description: "Matrix channel plugin (matrix-js-sdk)", configSchema: emptyPluginConfigSchema(), - async register(api: OpenClawPluginApi) { + register(api: OpenClawPluginApi) { setMatrixRuntime(api.runtime); - await ensureMatrixCryptoRuntime(); - const { matrixPlugin } = await import("./src/channel.js"); + void ensureMatrixCryptoRuntime({ log: api.logger.info }).catch((err) => { + const message = err instanceof Error ? err.message : String(err); + api.logger.warn?.(`matrix: crypto runtime bootstrap failed: ${message}`); + }); api.registerChannel({ plugin: matrixPlugin }); }, };