fix(matrix): use main plugin-sdk export for KeyedAsyncQueue#39873
fix(matrix): use main plugin-sdk export for KeyedAsyncQueue#39873reed1898 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR attempts to fix a Docker-only module resolution error for the Matrix plugin by switching the Critical Issue:
Recommended Fix: Confidence Score: 1/5
Last reviewed commit: 7607378 |
| @@ -1,4 +1,4 @@ | |||
| import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue"; | |||
| import { KeyedAsyncQueue } from "openclaw/plugin-sdk"; | |||
There was a problem hiding this 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.
| 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.7607378 to
180ad2b
Compare
|
修复了导入路径:使用 |
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
180ad2b to
96ccdfc
Compare
|
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. 🙏 |
|
OpenClaw now uses a new Matrix plugin built on the official 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: |
Summary
Fix Matrix plugin failing to load in Docker builds due to unresolved subpath import.
Problem
send-queue.tsimportsKeyedAsyncQueuefromopenclaw/plugin-sdk/keyed-async-queue. In Docker images, Rolldown bundlesplugin-sdkinto a singleindex.js, so the/keyed-async-queuesubpath doesn't resolve:All Matrix users on Docker are affected — the plugin fails silently.
Fix
Switch to the main
openclaw/plugin-sdkexport.KeyedAsyncQueueis already re-exported fromsrc/plugin-sdk/index.ts, so this resolves Docker while preserving dev-mode behavior.Closes #33266