Repository navigation
fix: retain minified lazy parser targets in standalone builds - #198639
Conversation
|
Codex review: needs maintainer review before merge. What this changesThis PR loads Acorn lazily through the runtime loader instead of first resolving its physical package metadata. Example: A standalone executable prepares /plugin/index.mjs containing import './dependency.mjs' after its original node_modules tree is removed.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a source-visible standalone plugin-loading failure still present on current main; no introduced correctness defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherPlugin source preparation inspects JavaScript and transformed TypeScript to discover module and asset references; standalone packaging supplies embedded dependencies through its existing loader adapters. flowchart TD
A[Plugin preparation] --> B[Source reference inspection]
B --> C[Lazy Acorn acquisition]
C --> D[Runtime require loader]
D --> E[Embedded Acorn parser]
E --> F[Module and asset references]
Technical reviewBest possible solution: Keep the existing lazy parser owner and let the established runtime loader resolve its literal Acorn dependency. Do we have a high-confidence way to reproduce the issue? The physical Acorn lookup on current main precedes the embedded loader, and the supplied regression removes that package tree before invoking source inspection; no target code was executed during this read-only review. Is this the best way to solve the issue? This is the smallest complete production repair: remove the filesystem prerequisite, preserve lazy acquisition, and reuse the established standalone loader without changing plugin contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 41d0dec31bfc. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -2, Tests +108. Total +106 across 2 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 13, 2026, 11:25 PM ET / November 14, 2026, 04:25 UTC. |
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Preserve constant-template package specifiers and export conditions at the standalone native adapter. Keep the existing lazy ESM parser identity and exercise discovery, transformation, and loading after source removal.
|
Merged via squash.
|
…aw#198639) * fix: resolve lazy plugin parser through the runtime loader * fix: resolve minified native module targets Preserve constant-template package specifiers and export conditions at the standalone native adapter. Keep the existing lazy ESM parser identity and exercise discovery, transformation, and loading after source removal.
) * fix(build): isolate standalone native export resolution Capture package exports in a fresh instance of the build runtime so earlier bundling cannot exhaust the resolver state used to build the native lookup table. Verify ambiguous missing entries independently and fail before publishing an incomplete artifact. * test: reconcile standalone regression allocation with CI base * test: share standalone native fixture setup (cherry picked from commit 00a9c52) Release adaptation: Exact fresh-process resolver/finalizer and unnamed-owner filtering; kept existing standalone test fixtures rather than importing broad refactor. Later parser-target fix bdfd1c0 and fixture cleanups independent/out of scope. No compiler/dependency/version changes. Follow-up dispositions: d44f263 fix(test): retain standalone fixtures after cleanup failure (openclaw#202227); 1aced63 fix(test): retain standalone resolver fixtures after cleanup failure (openclaw#201662); bdfd1c0 fix: retain minified lazy parser targets in standalone builds (openclaw#198639); 5f99927 fix: restore desktop standalone packaging on current build output (openclaw#198567) Validation: Baseline resolver regressions 2/2 failed with actual missing alias and swallowed error; candidate resolver+existing native tests 30/30 passed under pinned test runtime; node --check and diff --check passed. Full large standalone distribution build not run. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit b305470dfd611795999ecbee9d5d14c172e58484) (cherry picked from commit 63a60fa78bba92bec04a43a1686b78d896a6d887)
What Problem This Solves
Standalone plugin preparation fails to load its embedded Acorn parser when the minifier spells static strings as constant templates. The native dependency resolver recognizes only quoted literals, so the lazy module lookup falls through to a removed node_modules tree. Fetched Teams and TypeScript plugins report a missing Acorn package.
User Impact
Retain the existing lazy ESM parser dependency in standalone executables without requiring the original source package. Package-map helpers stay lazy, and plugin contracts and parser identity stay unchanged.
Why This Change Was Made
Teach the existing native module-resolution owner to read constant template specifiers and export conditions alongside quoted strings. This preserves the private parser loader instead of changing its module format or adding a runtime fallback. The earlier CJS-loader proposal in this PR was disproved by a signed artifact and has been replaced.
Evidence
e883a78ec5f3563cb755da1a460f815f3bfabb1dto the staged patch committed as8c4111ac68ebe79eb5eebe7b95a220886787ae04is P2 scoped-clean, with no accepted findings.