openclaw - ✅(Solved) Fix [Bug]: plugin-sdk/index.js broken in 2026.4.1 - submodules not re-exported [1 pull requests, 6 comments, 3 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#59326Fetched 2026-04-08 02:26:01
View on GitHub
Comments
6
Participants
3
Timeline
8
Reactions
0
Timeline (top)
commented ×3labeled ×2closed ×1cross-referenced ×1

dist/plugin-sdk/index.js 只 export 了 4 个 symbol (delegateCompactionToRuntime, emptyPluginConfigSchema, onDiagnosticEvent, registerContextEngine)

但很多子模块的实现在 .js 文件里存在(如 dist/plugin-sdk/temp-path.js export 了 resolvePreferredOpenClawTmpDir), 却没有被 index.js re-export,导致第三方插件(如 @tencent-weixin/openclaw-weixin) import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk" 失败。

Root Cause

dist/plugin-sdk/index.js 只 export 了 4 个 symbol (delegateCompactionToRuntime, emptyPluginConfigSchema, onDiagnosticEvent, registerContextEngine)

但很多子模块的实现在 .js 文件里存在(如 dist/plugin-sdk/temp-path.js export 了 resolvePreferredOpenClawTmpDir), 却没有被 index.js re-export,导致第三方插件(如 @tencent-weixin/openclaw-weixin) import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk" 失败。

Fix Action

Fixed

PR fix notes

PR #59364: fix(plugin-sdk): verify subpath dist exports match source re-exports

Description (problem / solution / changelog)

Summary

  • Add source-vs-dist export verification to scripts/check-plugin-sdk-exports.mjs so the build fails when bundled plugin-sdk subpath files silently drop re-exports during tree-shaking.
  • Catches the class of regression seen in v2026.4.1 where dist/plugin-sdk/channel-targets.js is missing runtime exports (resolveServicePrefixedTarget, resolveServicePrefixedAllowTarget, parseChatTargetPrefixesOrThrow, parseChatAllowTargetPrefixes) that are present in src/plugin-sdk/channel-targets.ts.

Context

In v2026.4.1, BlueBubbles reply delivery fails at runtime:

[bluebubbles] final reply failed: TypeError: (0 , _channelTargets.resolveServicePrefixedTarget) is not a function

The source file correctly re-exports from ../channels/plugins/chat-target-prefixes.js, but the compiled dist facade only includes exports from channel-config.js and targets.js — the chat-target-prefixes.js re-exports are silently dropped by the bundler.

The existing check-plugin-sdk-exports.mjs script only verified that subpath .js/.d.ts files exist, not that their contents match. This PR adds content-level verification: for each subpath entry, it parses the source export { ... } from "..." blocks (filtering type-only exports) and checks that every runtime export name appears in the dist output.

Related: #59326 (same class of bug, different symbol)

Test plan

  • pnpm build && node scripts/check-plugin-sdk-exports.mjs should fail on current v2026.4.1 dist (proving it catches the regression)
  • After a clean rebuild that fixes the bundler config, the check should pass
  • Verify no false positives on subpaths that use export * or barrel re-exports

Changed files

  • scripts/check-plugin-sdk-exports.mjs (modified, +82/-13)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

dist/plugin-sdk/index.js 只 export 了 4 个 symbol (delegateCompactionToRuntime, emptyPluginConfigSchema, onDiagnosticEvent, registerContextEngine)

但很多子模块的实现在 .js 文件里存在(如 dist/plugin-sdk/temp-path.js export 了 resolvePreferredOpenClawTmpDir), 却没有被 index.js re-export,导致第三方插件(如 @tencent-weixin/openclaw-weixin) import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk" 失败。

Steps to reproduce

但很多子模块的实现在 .js 文件里存在(如 dist/plugin-sdk/temp-path.js export 了 resolvePreferredOpenClawTmpDir), 却没有被 index.js re-export,导致第三方插件(如 @tencent-weixin/openclaw-weixin) import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk" 失败。

Expected behavior

受影响版本: 2026.4.1 重现方式: node -e "const m = require('openclaw/dist/plugin-sdk/index.js'); console.log(m.resolvePreferredOpenClawTmpDir)" // undefined

Actual behavior

无法启动openclaw-weixin

OpenClaw version

26.4.1

Operating system

macOS26.3

Install method

npm

Model

minimax2.7

Provider / routing chain

openclaw -> cloudflare-ai-gateway -> minimax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be fixed by re-exporting the missing symbols from index.js in the plugin-sdk directory.

Guidance

  • Identify the missing symbols that need to be re-exported from index.js, such as resolvePreferredOpenClawTmpDir.
  • Update index.js to re-export these symbols, for example by adding export { resolvePreferredOpenClawTmpDir } from './temp-path';.
  • Verify that the third-party plugin can now import the required symbols without errors.
  • Consider updating the build or bundling process to automatically include all exported symbols from sub-modules in the index.js file.

Example

// dist/plugin-sdk/index.js
export { delegateCompactionToRuntime, emptyPluginConfigSchema, onDiagnosticEvent, registerContextEngine };
export { resolvePreferredOpenClawTmpDir } from './temp-path';

Notes

The exact implementation may vary depending on the specific requirements and constraints of the project. It is also possible that there are other missing symbols that need to be re-exported.

Recommendation

Apply workaround: Update index.js to re-export the missing symbols, as this is a targeted fix that addresses the specific issue reported.

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…

FAQ

Expected behavior

受影响版本: 2026.4.1 重现方式: node -e "const m = require('openclaw/dist/plugin-sdk/index.js'); console.log(m.resolvePreferredOpenClawTmpDir)" // undefined

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: plugin-sdk/index.js broken in 2026.4.1 - submodules not re-exported [1 pull requests, 6 comments, 3 participants]