Fix bundled channel dist-runtime setup roots#82622
Conversation
Reintroduce the bundled dist-runtime setup-root handling from the reverted PR without the unrelated fixture expectation changes that broke main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
42872cb to
3e53c8b
Compare
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. at source level: current main lacks the Real behavior proof Next step before merge Security Review detailsBest possible solution: Land exactly one bundled-runtime path fix: either this narrow patch or the broader maintainer hardening PR, preserving Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main lacks the Is this the best way to solve the issue? Yes, the PR is a narrow maintainable fix for the reported packaged-runtime root mismatch. The only open solution choice is whether maintainers prefer this small patch or the broader related hardening PR. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4b0f16d496e5. |
|
Superseded: these earlier QA artifacts are not the proof for #82622. The screenshots were generated incorrectly and should be ignored. Use the fresh deterministic before/after proof now embedded in the PR body instead: https://raw.githubusercontent.com/giodl73-repo/openclaw/proof-artifacts/pr-82622-fresh/pr-82622/pr-82622-dist-runtime-before-after-proof.png |
|
Superseded: this earlier before/after screenshot pair was not reliable enough for #82622 review and should be ignored. Use the fresh deterministic before/after proof now embedded in the PR body instead: https://raw.githubusercontent.com/giodl73-repo/openclaw/proof-artifacts/pr-82622-fresh/pr-82622/pr-82622-dist-runtime-before-after-proof.png |
|
Updated #82622 with a fresh deterministic proof image and clearer PR body. The earlier generated screenshots for this PR were not reliable, so I marked those artifact comments as superseded. The new proof compares
Fresh proof image: https://raw.githubusercontent.com/giodl73-repo/openclaw/proof-artifacts/pr-82622-fresh/pr-82622/pr-82622-dist-runtime-before-after-proof.png |
|
Thanks for the focused replacement. This is now covered by the broader canonical fix in PR #82671. I compared the touched files: this PR's dist-runtime generated-entry/setup-root changes are included there, and #82671 adds the surrounding containment, package-state fallback, public-surface, changelog, and broader proof coverage. Closing this one so review/landing can stay on the canonical PR. |
Summary
dist-runtime/extensions/<plugin>as a packaged generated-entry lookup location before source fallback.dist-runtime/extensions/<channel>as the setup-entry module boundary root when the loaded setup module comes from packageddist-runtime.Fixes #77805. Replaces the relevant bundled-runtime portion of reverted #82472.
Why this shape
Packaged installs can have generated channel/plugin entries under
dist-runtime/extensions, while source checkouts still haveextensions. The previous behavior skippeddist-runtimein the generated-path search order, so a packaged setup entry could fall back to the source tree or use the wrong module boundary root. This PR makes packageddist-runtimean explicit first-class generated root without broadening the change beyond bundled channel/plugin resolution.Real behavior proof
dist/is absent butdist-runtime/extensions/<plugin>/index.jsexists, bundled generated entry resolution should prefer the packageddist-runtimeentry before falling back toextensions/<plugin>/index.ts.upstream/mainand PR head3e53c8bb8165e01a79f9f43c6530f1eec41efaba.upstream/mainandfork/fix-bundled-dist-runtime-setup-roots; in each worktree ranpnpm --silent exec tsx ./probe-dist-runtime-resolution.mjs. The probe created a temp package root containing bothextensions/plugin/index.tsanddist-runtime/extensions/plugin/index.js, then called the real exportedresolveBundledPluginGeneratedPath()and printed the resolved relative path.upstream/mainfalls back to the sourceextensions/plugin/index.ts, while the PR head resolves the packageddist-runtime/extensions/plugin/index.jsentry. This demonstrates the intended packaged generated-root behavior without relying on the earlier broken screenshots.Regression coverage
src/plugins/bundled-plugin-metadata.test.tsnow proves generated path resolution prefersdist-runtime/extensionsbefore source fallback when packageddistis absent.src/channels/plugins/bundled.shape-guard.test.tsnow proves packaged setup entries loaded fromdist-runtime/extensionsuse that package directory as their module boundary root.Validation
git diff --check