fix(plugin-loader): prefer native loading for compiled SDK imports#85353
fix(plugin-loader): prefer native loading for compiled SDK imports#85353FelixIsaac wants to merge 1 commit into
Conversation
|
Thanks for the context here. I did a careful shell check against current Current main already has the native-first plugin-loader behavior this branch proposed, with regression coverage, and the proof commit is included in v2026.6.6. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the shipped v2026.6.6 native-first loader implementation as the canonical fix and close this stale branch rather than merging a conflicting duplicate. Do we have a high-confidence way to reproduce the issue? Yes. The old base forced source transformation for SDK-importing compiled JavaScript, while current main now prefers native loading and has regression coverage for SDK aliases plus fallback behavior. Is this the best way to solve the issue? Yes. Current main uses the existing native loader and jiti fallback path, matching the narrow maintainable fix without adding a new loader surface. Security review: Security review cleared: The PR diff changes loader ordering and tests only; it adds no dependency, workflow, credential, install-script, or publishing surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against cae64ee360a8; fix evidence: release v2026.6.6, commit 68e6f03fd94f. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Tiny Branchling Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
3a1d38c to
766c0b5
Compare
|
Follow-up PR for the media/provider discovery optimization work is open here: #85368.\n\nIt is split onto a fresh branch from main so this PR can stay focused on the plugin-loader native-first change. |
|
Performance-audit harness follow-up is open as #85400: saved CLI startup benchmark reports can now be compared directly in text or JSON. This supports the small follow-up PR series with reusable before/after proof. |
|
@clawsweeper re-review Normalized the Real behavior proof section using the required field labels and copied live timing/output evidence already captured for this change. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper applied the proposed close for this PR.
|
Summary
This changes the plugin module loader to try native loading before forcing
jitisource transformation for compiled JavaScript files that importopenclaw/plugin-sdk/*.The loader still preserves the existing safety fallback: if native loading declines and the file needs plugin-sdk alias rewriting, it falls back to the alias-aware
jitipath.Why
On a 2026.5.18 install,
openclaw infer audio providers --jsonspent most of its cold-start time loading the Codex plugin throughjitieven though the plugin is already compiled JS.Real behavior proof (required for external PRs)
openclaw/plugin-sdk/*should prefer native loading before falling back to alias-awarejiti, reducing real CLI/plugin discovery startup time without breaking transcription.OPENCLAW_PLUGIN_LOAD_PROFILE=1 openclaw infer audio providers --json openclaw infer audio providers --json openclaw infer audio transcribe /tmp/openclaw-proof.ogg --provider openai --model gpt-4o-transcribe corepack pnpm exec vitest run src/plugins/plugin-module-loader-cache.test.tsjititransform path.openclaw infer audio providers --jsonat roughly 35-38s, with Codex discovery alone around 25-30s underOPENCLAW_PLUGIN_LOAD_PROFILE=1.Tests
corepack pnpm exec vitest run src/plugins/plugin-module-loader-cache.test.ts