Skip to content

fix(matrix): correct plugin-sdk import path for Docker bundle#33407

Closed
jameslcowan wants to merge 1 commit intoopenclaw:mainfrom
jameslcowan:fix/matrix-plugin-sdk-import
Closed

fix(matrix): correct plugin-sdk import path for Docker bundle#33407
jameslcowan wants to merge 1 commit intoopenclaw:mainfrom
jameslcowan:fix/matrix-plugin-sdk-import

Conversation

@jameslcowan
Copy link
Copy Markdown
Contributor

Summary

  • Problem: The Matrix plugin fails to load on Docker because send-queue.ts imports KeyedAsyncQueue from a subpath (openclaw/plugin-sdk/keyed-async-queue) that doesn't exist in the bundled Docker image.
  • Why it matters: Every Matrix user on Docker is broken silently — the container starts healthy but can't send or receive Matrix messages.
  • What changed: Updated the import to use the main openclaw/plugin-sdk export, where KeyedAsyncQueue is already re-exported.
  • What did NOT change: Runtime behavior is identical; the import resolves to the same class.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Integrations

Linked Issue/PR

User-visible / Behavior Changes

Matrix plugin loads correctly on Docker. No behavior change for non-Docker installs.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: Linux x86_64
  • Runtime/container: Docker (ghcr.io/openclaw/openclaw:latest)
  • Integration/channel: Matrix

Steps

  1. Pull ghcr.io/openclaw/openclaw:latest
  2. Configure a Matrix homeserver
  3. Start the gateway — Matrix plugin fails to load with Cannot find module '/app/dist/plugin-sdk/index.js/keyed-async-queue'

Expected

Matrix plugin loads and connects.

Actual

Plugin fails silently, Matrix messages don't work.

Evidence

Error before fix:

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

KeyedAsyncQueue is exported from plugin-sdk/index.js — verified in the built bundle.

Human Verification (required)

  • Verified KeyedAsyncQueue is exported from the main openclaw/plugin-sdk entry before changing the import.
  • Confirmed the only occurrence of the broken subpath in the matrix extension is this one line.
  • What I did not verify: full Docker build + runtime test (no Docker environment available locally).

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • Revert is a one-line change back to "openclaw/plugin-sdk/keyed-async-queue".
  • Symptom to watch: Matrix plugin fails to load on any environment.

Risks and Mitigations

  • Risk: KeyedAsyncQueue export removed from main plugin-sdk index in a future change.
    • Mitigation: Low risk — it's a core utility. Would be caught immediately by build/typecheck.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR fixes a Docker-specific module resolution failure in the Matrix plugin by changing the import of KeyedAsyncQueue from the subpath openclaw/plugin-sdk/keyed-async-queue to the main openclaw/plugin-sdk entry point. KeyedAsyncQueue is explicitly re-exported from src/plugin-sdk/index.ts (line 124), making the fix correct and functionally equivalent.

  • The subpath export ./plugin-sdk/keyed-async-queue is defined in package.json, so the old import worked in non-Docker environments — but the Docker bundle doesn't honour package subpath exports the same way, causing the load failure described in issue Matrix plugin fails to load in Docker: keyed-async-queue subpath not resolved #33266.
  • The vitest.config.ts already has a resolver alias for openclaw/plugin-sdksrc/plugin-sdk/index.ts (line 25–27), so the test suite will continue to resolve the import correctly.
  • No other files in the matrix extension use the broken subpath, confirming the change is complete.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, verified, one-line import correction with no behaviour change.
  • The fix is a single-line import change. KeyedAsyncQueue is confirmed exported from the target module (src/plugin-sdk/index.ts line 124), the vitest.config.ts test alias already covers the new import path, and the change is isolated to one file with no downstream side effects. The only unverified step (full Docker build + runtime test) is clearly noted by the author, and the risk is low given the evidence in the PR.
  • No files require special attention.

Last reviewed commit: dc1c78e

@openclaw-barnacle openclaw-barnacle bot added channel: matrix Channel integration: matrix size: XS labels Mar 3, 2026
@jameslcowan jameslcowan force-pushed the fix/matrix-plugin-sdk-import branch from dc1c78e to 037c8ec Compare March 14, 2026 01:39
@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