openclaw - ✅(Solved) Fix Mattermost plugin entry path escapes plugin root on v2026.4.5 [1 pull requests, 3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61681Fetched 2026-04-08 02:56:00
View on GitHub
Comments
3
Participants
4
Timeline
8
Reactions
1
Author
Timeline (top)
cross-referenced ×4commented ×3closed ×1

Error Message

Error: plugin entry path escapes plugin root: ./src/channel.js at resolveBundledEntryModulePath (channel-entry-contract-*.js)

Root Cause

extensions/mattermost/index.ts defines its plugin entry as:

plugin: {
    specifier: "./src/channel.js",
    exportName: "mattermostPlugin",
},

However:

  1. The build pipeline does not emit dist/extensions/mattermost/src/channel.js — the file doesn't exist in the build output.
  2. The new resolveBundledEntryModulePath security check (introduced in or before v2026.4.5) rejects ./src/ paths as escaping the plugin root.

Other channel plugins (e.g., telegram) use a flat specifier like ./channel-plugin-api.js which works correctly.

Fix Action

Workaround

Remove the mattermost extension from build output after each build:

rm -rf dist/extensions/mattermost dist-runtime/extensions/mattermost

PR fix notes

PR #61692: fix(mattermost): plugin entry path escapes plugin root on v2026.4.5

Description (problem / solution / changelog)

Bug

After building v2026.4.5, the gateway and all CLI commands crash at bootstrap with:

Error: plugin entry path escapes plugin root: ./src/channel.js
    at resolveBundledEntryModulePath (channel-entry-contract-*.js)

Root Cause

The build pipeline does not emit nested-path outputs (e.g. dist/extensions/mattermost/src/channel.js). The new resolveBundledEntryModulePath security check rejects ./src/ paths as escaping the plugin root.

Other channel plugins (e.g. telegram, whatsapp) use a flat specifier (e.g. ./channel-plugin-api.js) which works correctly.

Fix

  1. New file extensions/mattermost/channel-plugin-api.ts — thin re-export that keeps the plugin entry inside the plugin root:

    export { mattermostPlugin } from "./src/channel.js";
  2. Updated extensions/mattermost/index.ts — changed plugin specifier from "./src/channel.js" to "./channel-plugin-api.js", matching the pattern used by telegram and whatsapp plugins.

This is a minimal, safe fix — the actual plugin implementation is unchanged; only the entry path resolution is corrected.

Testing

After applying this fix, pnpm build should produce a working dist/extensions/mattermost/channel-plugin-api.js that passes the resolveBundledEntryModulePath security check.

Fixes #61681

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • docs.acp.md (added, +194/-0)
  • docs/cli/acp.md (added, +143/-0)
  • docs/cli/index.md (modified, +7/-0)
  • extensions/mattermost/channel-plugin-api.ts (added, +2/-0)
  • extensions/mattermost/index.ts (added, +33/-0)
  • package.json (modified, +1/-0)
  • pnpm-lock.yaml (modified, +14/-0)
  • src/acp/event-mapper.test.ts (added, +34/-0)
  • src/acp/event-mapper.ts (added, +73/-0)
  • src/acp/index.ts (added, +4/-0)
  • src/acp/meta.ts (added, +35/-0)
  • src/acp/server.ts (added, +149/-0)
  • src/acp/session-mapper.test.ts (added, +57/-0)
  • src/acp/session-mapper.ts (added, +95/-0)
  • src/acp/session.test.ts (added, +26/-0)
  • src/acp/session.ts (added, +93/-0)
  • src/acp/translator.ts (added, +420/-0)
  • src/acp/types.ts (added, +30/-0)
  • src/cli/acp-cli.ts (added, +43/-0)
  • src/cli/program/register.subclis.ts (modified, +2/-0)
  • src/gateway/server-bridge-methods-chat.ts (modified, +3/-0)
  • src/gateway/server-methods/chat.ts (modified, +3/-0)
  • src/routing/session-key.ts (modified, +12/-27)
  • src/sessions/session-key-utils.ts (added, +35/-0)

Code Example

Error: plugin entry path escapes plugin root: ./src/channel.js
    at resolveBundledEntryModulePath (channel-entry-contract-*.js)

---

plugin: {
    specifier: "./src/channel.js",
    exportName: "mattermostPlugin",
},

---

rm -rf dist/extensions/mattermost dist-runtime/extensions/mattermost
RAW_BUFFERClick to expand / collapse

Bug

After building v2026.4.5 (pnpm build), the gateway and all CLI commands (including openclaw doctor --fix) crash at bootstrap with:

Error: plugin entry path escapes plugin root: ./src/channel.js
    at resolveBundledEntryModulePath (channel-entry-contract-*.js)

This prevents the gateway from starting entirely.

Root Cause

extensions/mattermost/index.ts defines its plugin entry as:

plugin: {
    specifier: "./src/channel.js",
    exportName: "mattermostPlugin",
},

However:

  1. The build pipeline does not emit dist/extensions/mattermost/src/channel.js — the file doesn't exist in the build output.
  2. The new resolveBundledEntryModulePath security check (introduced in or before v2026.4.5) rejects ./src/ paths as escaping the plugin root.

Other channel plugins (e.g., telegram) use a flat specifier like ./channel-plugin-api.js which works correctly.

Impact

  • Severity: Critical — blocks gateway startup and all CLI commands
  • Scope: Every fresh pnpm build on v2026.4.5 is affected
  • The error occurs at bootstrap (before config is read), so plugins.disable or doctor --fix cannot help

Workaround

Remove the mattermost extension from build output after each build:

rm -rf dist/extensions/mattermost dist-runtime/extensions/mattermost

Expected Fix

Either:

  1. Align mattermost's entry specifier to a flat path (like other plugins: ./channel-plugin-api.js), or
  2. Ensure the build pipeline emits dist/extensions/mattermost/src/channel.js

Environment

  • openclaw v2026.4.5 (tag v2026.4.5)
  • Node 22
  • macOS (launchd gateway)

extent analysis

TL;DR

Update the extensions/mattermost/index.ts file to use a flat specifier path for the plugin entry, similar to other channel plugins.

Guidance

  • Verify the build pipeline configuration to ensure it emits the required files, specifically dist/extensions/mattermost/src/channel.js.
  • Check the resolveBundledEntryModulePath security check implementation to understand the path validation logic.
  • Consider updating the extensions/mattermost/index.ts file to use a flat specifier path, such as ./channel-plugin-api.js, to align with other working plugins.
  • As a temporary workaround, remove the mattermost extension from the build output after each build using the provided rm command.

Example

// Update extensions/mattermost/index.ts to use a flat specifier path
plugin: {
    specifier: "./channel-plugin-api.js",
    exportName: "mattermostPlugin",
},

Notes

The provided workaround may not be a permanent solution, and the root cause should be addressed by updating the build pipeline or the plugin entry specifier.

Recommendation

Apply the workaround by removing the mattermost extension from the build output after each build, as this provides a temporary solution to the critical issue blocking gateway startup.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING