Repository navigation
fix: restore worker imports in plugin SDK loaders - #164662
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
8047086 to
90ec7e5
Compare
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 9:27 PM ET / October 4, 2026, 01:27 UTC. ClawSweeper reviewWhat this changesThe PR restores resolution of the private worker package through existing plugin SDK loaders for source checkouts and packaged installations. Merge readiness✅ Ready for maintainer review The repair remains necessary on fetched main. The pinned changes fit the existing loader contracts, and no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherPlugin SDK loaders connect plugin imports to OpenClaw’s host libraries. Their aliases select available source or built artifacts so plugins can use process and worker helpers. flowchart TD
A[Plugin imports] --> B[Plugin SDK loader]
B --> C[Host and parent-root selection]
C --> D[Source or built artifact selection]
D --> E[Worker package entrypoints]
E --> F[Process and worker helpers]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +3, Tests +32. Total +35 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep worker-package resolution in the existing loaders while preserving host identity, parent-root isolation, and source/packaged selection. Do we have a high-confidence way to reproduce the issue? Yes, source inspection establishes the missing alias path from the process SDK to the private worker package. The extended native ESM fixture provides a focused regression path, but this review did not execute it. Is this the best way to solve the issue? Yes, extending the existing alias inventories is the narrow repair; it preserves public entrypoints and avoids requiring plugins to depend on a private host package. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fd69a4eedd30. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Fixed: plugin SDK loaders resolve worker helpers from source checkouts and packaged installs. |
…164662) Restore worker-runtime imports through the plugin SDK loaders for source checkouts and packaged installs while preserving native parent-root restrictions.
What Problem This Solves
The worker-runtime extraction in #164537 left plugin SDK loading paths unable to resolve the new private package. Offline memory status fails while the native plugin loader imports
process-runtime. Native ESM plugins can fail at the same boundary when they load a source SDK without prebuilt worker-package artifacts.User Impact
Source-based plugin SDK consumers can load worker helpers again, and packaged resolution recognizes the existing root
dist/worker-runtimeartifacts. Public SDK entrypoints remain unchanged; plugins do not need to add a dependency on the private worker package. There is no configuration change, state migration, or visible UI change.Why This Change Was Made
The core test resolver already knows the package, but Jiti and the persistent native loader maintain separate explicit alias sets. Register the root, worker, and lifecycle entrypoints with those existing owners while retaining their source/dist selection and parent-root restrictions. Extend the existing regression cases to cover source and packaged layouts, plus an external plugin loading a source-only SDK through native ESM with worker package artifacts absent.
The UI test alias correction in #164061 is already on the base branch; this PR contains only the remaining plugin-loader changes and their regression coverage.
Evidence
The scheduled main CI run 37164039730 recorded the missing worker-runtime import in offline memory status. On the Cloud Mac, removing only the native registration from this candidate made the source-only ESM regression fail because it selected a worker package without the fixture's expected export. Restoring the exact PR source made the complete focused batch pass.
At
90ec7e53336c7705df1d93fc7e15b47c41d53b74, Node 24.21.0 and pnpm 12.5.1 on the Cloud Mac passed 102 tests across five files, with one existing Windows-only case skipped. The batch took 48.68 seconds wall time, including 14.13 seconds of cold compiled-worker preparation:The extended source/dist alias cases took 12 ms and 10 ms; the native ESM assertion took 1 ms after its shared probe setup. The negative control took 3.04 seconds. The checkout remained clean at the same head and tree after proof.
Exact-head CI passed all 53 executed jobs. This includes runtime/Control UI builds and real-Gateway tests. The selected SDK boundary job freshly emitted 11,962 declarations for 210 SDK roots, including the changed resolver modules and worker-runtime entrypoints, and passed Codex, Slack, and Telegram consumer compilation. These results supply the relevant build/type evidence without repeating the same runtime build on the Cloud Mac.
Changed-file formatting and focused type-aware source lint passed. The final four plugin-loader files are unchanged from the reviewed candidate; the rebase only removed the UI alias hunk already supplied by main.