fix: resolve duplicate property definition in Matrix plugin#50919
fix: resolve duplicate property definition in Matrix plugin#50919bugkill3r wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a
Confidence Score: 4/5
Last reviewed commit: "fix: trim pre-export..." |
|
@greptile-apps review |
afc3ed4 to
c21fa92
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c21fa92700
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Star re-export for the remaining (non-extension) symbols in plugin-sdk/matrix. | ||
| // Properties already defined above are skipped by the CJS interop guard, so the | ||
| // circular helper-api path is never reached for those symbols. | ||
| export * from "openclaw/plugin-sdk/matrix"; |
There was a problem hiding this comment.
Restore a resolvable plugin-sdk target here
Any path that loads extensions/matrix/src/runtime-api.ts now hard-fails before the Matrix plugin can register, because openclaw/plugin-sdk/matrix is not a public package subpath. package.json only exports ./plugin-sdk/matrix-runtime-heavy and ./plugin-sdk/matrix-runtime-shared, and src/plugin-sdk/subpaths.test.ts explicitly asserts that matrix stays off the curated subpath list, so Node/Jiti resolves this as ERR_PACKAGE_PATH_NOT_EXPORTED. Since extensions/matrix/index.ts imports src/channel.ts, which in turn imports ./runtime-api.js, this breaks normal Matrix plugin startup rather than just an edge case.
Useful? React with 👍 / 👎.
Missing symbols in pre-export list — 6 of 15 circular-path symbols omittedTested on v2026.3.22 with Root cause
Missing 6 symbolsfindMatrixAccountEntry,
matrixSetupAdapter,
matrixSetupWizard,
resolveConfiguredMatrixAccountIds,
resolveMatrixAccountStringValues,
resolveMatrixChannelConfig,
Complete fix (all 15 from matrix-Cm_PTzgs.js)
export {
findMatrixAccountEntry,
getMatrixScopedEnvVarNames,
matrixSetupAdapter,
matrixSetupWizard,
requiresExplicitMatrixDefaultAccount,
resolveConfiguredMatrixAccountIds,
resolveMatrixAccountStorageRoot,
resolveMatrixAccountStringValues,
resolveMatrixChannelConfig,
resolveMatrixCredentialsDir,
resolveMatrixCredentialsPath,
resolveMatrixDefaultOrOnlyAccountId,
resolveMatrixLegacyFlatStoragePaths,
setMatrixThreadBindingIdleTimeoutBySessionKey,
setMatrixThreadBindingMaxAgeBySessionKey,
} from "openclaw/plugin-sdk/matrix";
Verification
With all 15 pre-exported in extensions/matrix/src/runtime-api.ts, the plugin loads cleanly — proceeds to crypto bootstrap and homeserver connection. No TypeError. |
…tartup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919.
…tartup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues #50868, #52780, and #52891, and uses the same fix pattern as PR #50919.
…tartup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919.
…tartup (#53221) * fix(line): pre-export clashing symbols to prevent jiti TypeError on startup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues #50868, #52780, and #52891, and uses the same fix pattern as PR #50919. * test: add LINE runtime-api Jiti regression (#53221) (thanks @Drickon) * test: stabilize LINE Jiti regression (#53221) (thanks @Drickon) * test: harden LINE Jiti regression (#53221) (thanks @Drickon) * chore: retrigger PR checks (#53221) --------- Co-authored-by: Peter Steinberger <[email protected]>
…tartup (openclaw#53221) * fix(line): pre-export clashing symbols to prevent jiti TypeError on startup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919. * test: add LINE runtime-api Jiti regression (openclaw#53221) (thanks @Drickon) * test: stabilize LINE Jiti regression (openclaw#53221) (thanks @Drickon) * test: harden LINE Jiti regression (openclaw#53221) (thanks @Drickon) * chore: retrigger PR checks (openclaw#53221) --------- Co-authored-by: Peter Steinberger <[email protected]>
…tartup (openclaw#53221) * fix(line): pre-export clashing symbols to prevent jiti TypeError on startup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919. * test: add LINE runtime-api Jiti regression (openclaw#53221) (thanks @Drickon) * test: stabilize LINE Jiti regression (openclaw#53221) (thanks @Drickon) * test: harden LINE Jiti regression (openclaw#53221) (thanks @Drickon) * chore: retrigger PR checks (openclaw#53221) --------- Co-authored-by: Peter Steinberger <[email protected]>
…tartup (openclaw#53221) * fix(line): pre-export clashing symbols to prevent jiti TypeError on startup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919. * test: add LINE runtime-api Jiti regression (openclaw#53221) (thanks @Drickon) * test: stabilize LINE Jiti regression (openclaw#53221) (thanks @Drickon) * test: harden LINE Jiti regression (openclaw#53221) (thanks @Drickon) * chore: retrigger PR checks (openclaw#53221) --------- Co-authored-by: Peter Steinberger <[email protected]>
…tartup (openclaw#53221) * fix(line): pre-export clashing symbols to prevent jiti TypeError on startup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919. * test: add LINE runtime-api Jiti regression (openclaw#53221) (thanks @Drickon) * test: stabilize LINE Jiti regression (openclaw#53221) (thanks @Drickon) * test: harden LINE Jiti regression (openclaw#53221) (thanks @Drickon) * chore: retrigger PR checks (openclaw#53221) --------- Co-authored-by: Peter Steinberger <[email protected]>
…tartup (openclaw#53221) * fix(line): pre-export clashing symbols to prevent jiti TypeError on startup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919. * test: add LINE runtime-api Jiti regression (openclaw#53221) (thanks @Drickon) * test: stabilize LINE Jiti regression (openclaw#53221) (thanks @Drickon) * test: harden LINE Jiti regression (openclaw#53221) (thanks @Drickon) * chore: retrigger PR checks (openclaw#53221) --------- Co-authored-by: Peter Steinberger <[email protected]>
…ut handling extensions/line/runtime-api.ts: pre-export local symbols that overlap with line-runtime before the star-re-export so jiti's _exportNames guard skips the duplicate defineProperty call. Same fix as Matrix PR openclaw#50919. This fix must be re-checked after rebases that touch this file. src/agents/subagent-announce.ts: - Lower OUTPUT_THRESHOLD to 2,500 chars (was 30,000 from uncommitted change, restoring intent of original 3,000 but tighter) - Keep preview slice at 1,500 chars (reverts Atlas's 12,000 bump) - Pass savedFilePath into buildAnnounceReplyInstruction so the reply instruction explicitly tells the agent to read the full output file when output was truncated, rather than leaving a subtle italic hint Also: regenerate stale base config schema; add void to pre-existing floating-promise lint errors in message-preprocess-hooks.test.ts.
…tartup (openclaw#53221) * fix(line): pre-export clashing symbols to prevent jiti TypeError on startup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919. * test: add LINE runtime-api Jiti regression (openclaw#53221) (thanks @Drickon) * test: stabilize LINE Jiti regression (openclaw#53221) (thanks @Drickon) * test: harden LINE Jiti regression (openclaw#53221) (thanks @Drickon) * chore: retrigger PR checks (openclaw#53221) --------- Co-authored-by: Peter Steinberger <[email protected]>
c21fa92 to
f35d797
Compare
|
Thanks @sambegui for the thorough testing! You're absolutely right — I've updated the PR to pre-export all 15 circular-path symbols from their local sources. The complete list now covers findMatrixAccountEntry, matrixSetupAdapter, matrixSetupWizard, resolveConfiguredMatrixAccountIds, resolveMatrixAccountStringValues, and resolveMatrixChannelConfig in addition to the original 9. Also rebased onto latest main. |
…tartup (openclaw#53221) * fix(line): pre-export clashing symbols to prevent jiti TypeError on startup When jiti CJS-transforms extensions/line/runtime-api.ts, both export * from "openclaw/plugin-sdk/line-runtime" and the subsequent export * from individual source files attempt to define the same 13 symbols via Object.defineProperty with configurable:false. The second call throws TypeError: Cannot redefine property. The root cause is that src/plugin-sdk/line-runtime.ts re-exports these symbols directly from the extension source files, creating a circular path back to the same files that runtime-api.ts star-exports. Fix: add named pre-exports for all symbols that plugin-sdk/line-runtime re-exports from this extension. Named exports register in jiti's _exportNames map at transform time; the star re-export's hasOwnProperty guard then skips them, preventing the duplicate Object.defineProperty. export * reordering cannot fix this: _exportNames is only populated by named exports, not by export *, so the guard never fires regardless of order. This is the same class of bug as the Matrix plugin crash described in issues openclaw#50868, openclaw#52780, and openclaw#52891, and uses the same fix pattern as PR openclaw#50919. * test: add LINE runtime-api Jiti regression (openclaw#53221) (thanks @Drickon) * test: stabilize LINE Jiti regression (openclaw#53221) (thanks @Drickon) * test: harden LINE Jiti regression (openclaw#53221) (thanks @Drickon) * chore: retrigger PR checks (openclaw#53221) --------- Co-authored-by: Peter Steinberger <[email protected]>
…ut handling extensions/line/runtime-api.ts: pre-export local symbols that overlap with line-runtime before the star-re-export so jiti's _exportNames guard skips the duplicate defineProperty call. Same fix as Matrix PR openclaw#50919. This fix must be re-checked after rebases that touch this file. src/agents/subagent-announce.ts: - Lower OUTPUT_THRESHOLD to 2,500 chars (was 30,000 from uncommitted change, restoring intent of original 3,000 but tighter) - Keep preview slice at 1,500 chars (reverts Atlas's 12,000 bump) - Pass savedFilePath into buildAnnounceReplyInstruction so the reply instruction explicitly tells the agent to read the full output file when output was truncated, rather than leaving a subtle italic hint Also: regenerate stale base config schema; add void to pre-existing floating-promise lint errors in message-preprocess-hooks.test.ts.
…ut handling extensions/line/runtime-api.ts: pre-export local symbols that overlap with line-runtime before the star-re-export so jiti's _exportNames guard skips the duplicate defineProperty call. Same fix as Matrix PR openclaw#50919. This fix must be re-checked after rebases that touch this file. src/agents/subagent-announce.ts: - Lower OUTPUT_THRESHOLD to 2,500 chars (was 30,000 from uncommitted change, restoring intent of original 3,000 but tighter) - Keep preview slice at 1,500 chars (reverts Atlas's 12,000 bump) - Pass savedFilePath into buildAnnounceReplyInstruction so the reply instruction explicitly tells the agent to read the full output file when output was truncated, rather than leaving a subtle italic hint Also: regenerate stale base config schema; add void to pre-existing floating-promise lint errors in message-preprocess-hooks.test.ts.
…ut handling extensions/line/runtime-api.ts: pre-export local symbols that overlap with line-runtime before the star-re-export so jiti's _exportNames guard skips the duplicate defineProperty call. Same fix as Matrix PR openclaw#50919. This fix must be re-checked after rebases that touch this file. src/agents/subagent-announce.ts: - Lower OUTPUT_THRESHOLD to 2,500 chars (was 30,000 from uncommitted change, restoring intent of original 3,000 but tighter) - Keep preview slice at 1,500 chars (reverts Atlas's 12,000 bump) - Pass savedFilePath into buildAnnounceReplyInstruction so the reply instruction explicitly tells the agent to read the full output file when output was truncated, rather than leaving a subtle italic hint Also: regenerate stale base config schema; add void to pre-existing floating-promise lint errors in message-preprocess-hooks.test.ts.
…ut handling extensions/line/runtime-api.ts: pre-export local symbols that overlap with line-runtime before the star-re-export so jiti's _exportNames guard skips the duplicate defineProperty call. Same fix as Matrix PR openclaw#50919. This fix must be re-checked after rebases that touch this file. src/agents/subagent-announce.ts: - Lower OUTPUT_THRESHOLD to 2,500 chars (was 30,000 from uncommitted change, restoring intent of original 3,000 but tighter) - Keep preview slice at 1,500 chars (reverts Atlas's 12,000 bump) - Pass savedFilePath into buildAnnounceReplyInstruction so the reply instruction explicitly tells the agent to read the full output file when output was truncated, rather than leaving a subtle italic hint Also: regenerate stale base config schema; add void to pre-existing floating-promise lint errors in message-preprocess-hooks.test.ts.
Summary
TypeError: Cannot redefine property: requiresExplicitMatrixDefaultAccountwhen loading Matrix pluginCloses #50868