Skip to content

fix(matrix): resolve keyed-async-queue import for Docker builds#33269

Closed
ecohash-co wants to merge 1 commit intoopenclaw:mainfrom
ecohash-co:fix/matrix-keyed-async-queue-import
Closed

fix(matrix): resolve keyed-async-queue import for Docker builds#33269
ecohash-co wants to merge 1 commit intoopenclaw:mainfrom
ecohash-co:fix/matrix-keyed-async-queue-import

Conversation

@ecohash-co
Copy link
Copy Markdown

Summary

  • Fix Matrix plugin failing to load in Docker image due to keyed-async-queue subpath not resolving after Rolldown bundling
  • Change import from "openclaw/plugin-sdk/keyed-async-queue" to "openclaw/plugin-sdk" (where KeyedAsyncQueue is already re-exported)

Problem

The Docker image bundles plugin-sdk into a single index.js via Rolldown. The /keyed-async-queue subpath export declared in package.json doesn't produce a separate chunk in the bundle, so the Matrix extension's import fails:

[plugins] matrix failed to load: Cannot find module '/app/dist/plugin-sdk/index.js/keyed-async-queue'

This silently breaks Matrix for all Docker users — the container starts healthy but can't send or receive messages.

Fix

One-line import change. KeyedAsyncQueue is already re-exported from the main plugin-sdk/index.ts barrel (export { enqueueKeyedTask, KeyedAsyncQueue } from "./keyed-async-queue.js"), so importing from the top-level path works in both bundled (Docker) and unbundled (npm) environments.

Test plan

  • Verified KeyedAsyncQueue is exported from plugin-sdk/index.js in the Docker bundle
  • Verified Matrix plugin loads successfully with the patched import (4 bots, self-hosted Synapse)
  • E2EE handshake completes, messages send and receive normally

Fixes #33266

The bundler (Rolldown) compiles plugin-sdk into a single index.js,
so the /keyed-async-queue subpath doesn't resolve as a separate
module in the Docker image. KeyedAsyncQueue is already re-exported
from the main plugin-sdk barrel, so importing from there works in
both bundled (Docker) and unbundled (npm) environments.

Fixes openclaw#33266
@openclaw-barnacle openclaw-barnacle bot added channel: matrix Channel integration: matrix size: XS labels Mar 3, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR fixes a runtime module-resolution failure that silently prevented the Matrix plugin from loading inside Docker builds. Rolldown bundles plugin-sdk into a single index.js, so the /keyed-async-queue subpath export never produces a separate chunk and the import path fails at runtime. Switching to the top-level barrel import ("openclaw/plugin-sdk") works in both environments because KeyedAsyncQueue is already re-exported from src/plugin-sdk/index.ts at line 124.

  • Changed one import line in extensions/matrix/src/matrix/send-queue.ts — no logic changes.
  • Verified that KeyedAsyncQueue is correctly exported from the main plugin-sdk barrel.
  • Usage of KeyedAsyncQueue (instantiation at line 11, enqueue calls at line 20) is correct.
  • No new tests are required; existing Matrix integration tests and the author's manual E2EE verification cover the affected path.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, verified import-path correction with no logic changes.
  • The change is a single-line import path fix. The target export (KeyedAsyncQueue) is confirmed present in src/plugin-sdk/index.ts line 124, and the new import path is the canonical way the codebase should consume plugin-sdk. The fix resolves a real Docker runtime issue where Rolldown bundles plugin-sdk into a single index.js without producing separate subpath chunks. There is no risk of behavioral regression since the imported class is used identically before and after.
  • No files require special attention.

Last reviewed commit: 02cfa30

@gumadeiras
Copy link
Copy Markdown
Member

OpenClaw now uses a new Matrix plugin built on the official matrix-js-sdk. The older Matrix implementation is no longer supported.

Closing this as potentially fixed in the new plugin. If this still reproduces after migrating, please open a new issue/PR against the new Matrix plugin and link back here.

Migration/docs:
https://docs.openclaw.ai/channels/matrix
https://docs.openclaw.ai/install/migrating-matrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Matrix plugin fails to load in Docker: keyed-async-queue subpath not resolved

3 participants