fix(channels): keep bundled dist loads off native Jiti on Windows#62286
Conversation
Greptile SummaryThis PR correctly identifies and fixes the
Confidence Score: 4/5Safe to merge as a partial fix; three sibling loader seams with the identical bug remain unpatched The fix is correct and the new tests are well-structured. However three getJiti functions in public-surface-loader.ts, bundled-channel-config-metadata.ts, and facade-runtime.ts retain the unguarded dist-path override, leaving Windows users who reach those seams still exposed to ERR_UNSUPPORTED_ESM_URL_SCHEME. src/plugins/public-surface-loader.ts (line 73), src/plugins/bundled-channel-config-metadata.ts (line 83), src/plugin-sdk/facade-runtime.ts (line 222)
|
d724b74 to
15a54b5
Compare
|
Landed via temp rebase onto main.
Thanks @chen-zhang-cs-code! |
Summary
ERR_UNSUPPORTED_ESM_URL_SCHEMEduringopenclaw onboard/openclaw configureeven thoughshouldPreferNativeJiti()already disables native Jiti on Windows.dist/**paths on Windows, and add focused regression tests for both seams.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
src/channels/plugins/module-loader.tsandsrc/plugin-sdk/channel-entry-contract.ts) re-enabledtryNativefordist/**module paths even on Windows, which bypassed the existingshouldPreferNativeJiti()guard and let Jiti hand rawC:\...paths to native ESM import.dist/**channel loads stay off native Jiti.dist/** => tryNativeshortcut.Regression Test Plan (if applicable)
src/channels/plugins/module-loader.test.ts,src/plugin-sdk/channel-entry-contract.test.tsdist/**bundled channel loads and sidecar loads must instantiate Jiti withtryNative: false.User-visible / Behavior Changes
ERR_UNSUPPORTED_ESM_URL_SCHEMEfrom these bundled-channel loader paths during onboarding/configure flows.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
dist/**channel entry throughsrc/channels/plugins/module-loader.ts.dist/**sidecar throughsrc/plugin-sdk/channel-entry-contract.ts.tryNative: false.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
pnpm test src/channels/plugins/module-loader.test.ts src/plugin-sdk/channel-entry-contract.test.tsand confirmed the new Windows-specific regression cases pass.dist/**loads off native Jiti on Windows.openclaw onboard/openclaw configurerun in this environment.Review Conversations
Compatibility / Migration
Risks and Mitigations
dist/**paths.Extra Verification Notes
pnpm checkis currently blocked by unrelated existingextensions/acpxtype-resolution errors (Cannot find module 'acpx/dist/runtime.js').runtime-postbuildby a Windows symlinkEPERMinacpx, after a successfulcanvas-a2uibundle step. These failures are outside the touched files.