Skip to content

fix(matrix): use main plugin-sdk export for KeyedAsyncQueue#39873

Closed
reed1898 wants to merge 1 commit intoopenclaw:mainfrom
reed1898:fix/matrix-docker-import-path
Closed

fix(matrix): use main plugin-sdk export for KeyedAsyncQueue#39873
reed1898 wants to merge 1 commit intoopenclaw:mainfrom
reed1898:fix/matrix-docker-import-path

Conversation

@reed1898
Copy link
Copy Markdown
Contributor

@reed1898 reed1898 commented Mar 8, 2026

Summary

Fix Matrix plugin failing to load in Docker builds due to unresolved subpath import.

Problem

send-queue.ts imports KeyedAsyncQueue from openclaw/plugin-sdk/keyed-async-queue. In Docker images, Rolldown bundles plugin-sdk into a single index.js, so the /keyed-async-queue subpath doesn't resolve:

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

All Matrix users on Docker are affected — the plugin fails silently.

Fix

Switch to the main openclaw/plugin-sdk export. KeyedAsyncQueue is already re-exported from src/plugin-sdk/index.ts, so this resolves Docker while preserving dev-mode behavior.

-import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
+import { KeyedAsyncQueue } from "openclaw/plugin-sdk";

Closes #33266

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

greptile-apps bot commented Mar 8, 2026

Greptile Summary

This PR attempts to fix a Docker-only module resolution error for the Matrix plugin by switching the KeyedAsyncQueue import from a scoped subpath to the monolithic openclaw/plugin-sdk root entry. However, the project enforces a lint rule (lint:plugins:no-monolithic-plugin-sdk-entry-imports) that explicitly forbids bundled plugins from importing this pattern. The change will immediately fail CI.

Critical Issue:

  • The modified import violates the check-no-monolithic-plugin-sdk-entry-imports lint rule, which is part of the standard pnpm check CI pipeline.
  • The lint check will detect the exact string "openclaw/plugin-sdk" and exit with a non-zero code.

Recommended Fix:
Instead of using the monolithic root entry, expose KeyedAsyncQueue through one of the existing scoped subpaths (openclaw/plugin-sdk/core, openclaw/plugin-sdk/compat, or openclaw/plugin-sdk/matrix). This resolves the Docker issue without violating the lint guard.

Confidence Score: 1/5

  • Not safe to merge — the change violates an enforced lint rule and will fail CI immediately.
  • The PR introduces a single-line change that directly contradicts the lint:plugins:no-monolithic-plugin-sdk-entry-imports lint rule. This check is part of the standard pnpm check pipeline and will cause the build to fail. The monolithic import pattern is explicitly forbidden for bundled plugins, and while the intent to fix Docker compatibility is sound, the chosen approach violates project-wide guardrails.
  • extensions/matrix/src/matrix/send-queue.ts — must use a scoped subpath instead of the monolithic root entry.

Last reviewed commit: 7607378

@@ -1,4 +1,4 @@
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
import { KeyedAsyncQueue } from "openclaw/plugin-sdk";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import violates the lint:plugins:no-monolithic-plugin-sdk-entry-imports lint rule, which is enforced in CI via pnpm check.

The repository forbids bundled plugin source files from importing the monolithic "openclaw/plugin-sdk" specifier. The lint check (scripts/check-no-monolithic-plugin-sdk-entry-imports.ts) will match this exact string and exit with:

Bundled plugin source files must not import monolithic openclaw/plugin-sdk.
Use openclaw/plugin-sdk/<channel> for channel plugins, /core for startup surfaces, or /compat for broader internals.

To fix the Docker resolution issue without breaking the lint rule, expose KeyedAsyncQueue through an existing scoped subpath (e.g., openclaw/plugin-sdk/core or openclaw/plugin-sdk/matrix) rather than the monolithic root. The original /keyed-async-queue subpath is correctly registered in package.json — the Docker issue is that Rolldown collapses it into a single index.js and then fails to resolve the path segment appended to that file. A scoped intermediate subpath would avoid this problem while complying with the lint guard.

Suggested change
import { KeyedAsyncQueue } from "openclaw/plugin-sdk";
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/core";

(subject to KeyedAsyncQueue being exported from the chosen scoped subpath)

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/matrix/src/matrix/send-queue.ts
Line: 1

Comment:
This import violates the `lint:plugins:no-monolithic-plugin-sdk-entry-imports` lint rule, which is enforced in CI via `pnpm check`.

The repository forbids bundled plugin source files from importing the monolithic `"openclaw/plugin-sdk"` specifier. The lint check (`scripts/check-no-monolithic-plugin-sdk-entry-imports.ts`) will match this exact string and exit with:

```
Bundled plugin source files must not import monolithic openclaw/plugin-sdk.
Use openclaw/plugin-sdk/<channel> for channel plugins, /core for startup surfaces, or /compat for broader internals.
```

To fix the Docker resolution issue without breaking the lint rule, expose `KeyedAsyncQueue` through an existing scoped subpath (e.g., `openclaw/plugin-sdk/core` or `openclaw/plugin-sdk/matrix`) rather than the monolithic root. The original `/keyed-async-queue` subpath is correctly registered in `package.json` — the Docker issue is that Rolldown collapses it into a single `index.js` and then fails to resolve the path segment appended to that file. A scoped intermediate subpath would avoid this problem while complying with the lint guard.

```suggestion
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/core";
```
(subject to `KeyedAsyncQueue` being exported from the chosen scoped subpath)

How can I resolve this? If you propose a fix, please make it concise.

@reed1898
Copy link
Copy Markdown
Contributor Author

reed1898 commented Mar 9, 2026

修复了导入路径:使用 openclaw/plugin-sdk/compat 子路径代替根入口,解决 Docker 模块解析问题且不违反 lint:plugins:no-monolithic-plugin-sdk-entry-imports lint 规则。

The Matrix plugin's send-queue.ts imports KeyedAsyncQueue from the
openclaw/plugin-sdk/keyed-async-queue subpath. In Docker builds, Rolldown
bundles plugin-sdk into a single index.js, so the subpath doesn't resolve
and the Matrix plugin fails to load.

KeyedAsyncQueue is already re-exported from the main plugin-sdk entry
(src/plugin-sdk/index.ts), so switching to the main export fixes Docker
while preserving dev-mode behavior.

Closes openclaw#33266
@reed1898 reed1898 force-pushed the fix/matrix-docker-import-path branch from 180ad2b to 96ccdfc Compare March 13, 2026 23:11
@reed1898
Copy link
Copy Markdown
Contributor Author

Friendly ping — this is a one-line import path fix that resolves Docker-only module resolution failures for the Matrix plugin. No conflicts, rebased on main.

Would appreciate a quick review. 🙏

@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

2 participants