Fix bundled channel dist-runtime setup roots#82472
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: Do we have a high-confidence way to reproduce the issue? No live current-main doctor run was performed in this read-only pass. Source inspection reaches the missing Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the narrow resolver and boundary-root fix after maintainer review and real packaged doctor proof, then close the linked issue with the regression evidence. Do we have a high-confidence way to reproduce the issue? Do we have a high-confidence way to reproduce the issue? No live current-main doctor run was performed in this read-only pass. Source inspection reaches the missing Is this the best way to solve the issue? Is this the best way to solve the issue? Yes, based on source review: recognizing the missing packaged runtime root while preserving What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against df0d061c7a9c. |
Resolve bundled channel generated entries from dist-runtime before falling back to source paths, and select the dist-runtime plugin root as the boundary root for packaged setup modules. This keeps the fs-safe module open boundary check intact while preventing packaged bundled setup entries from being checked against the source extensions root. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
30c56fa to
f361780
Compare
Update current-main tests that wrote persisted session entries without valid session IDs after session store loading started filtering invalid entries. Keep the fixture-only repair separate from the bundled channel loader fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
dist-runtime/extensionsbefore falling back to source paths when packageddistartifacts are absent.dist-runtimebundled channel root as the setup-entry module boundary root instead of falling back to sourceextensions.openRootFileSynccontainment/alias check and add regressions for packaged setup-entry loading.sessionIdmetadata.Fixes #77805.
Tests
CI=1 node scripts/run-vitest.mjs src/plugins/bundled-plugin-metadata.test.ts src/channels/plugins/bundled.shape-guard.test.ts src/channels/plugins/read-only.test.ts src/channels/plugins/bundled-root-caches.test.tsCI=1 node scripts/run-vitest.mjs src/gateway/server.sessions.create.test.ts src/commands/doctor-heartbeat-session-target.test.ts src/auto-reply/reply/session.test.ts -t "replaces a dead main entry|uses runtime session canonicalization|scoped WhatsApp group entry only contains activation state"CI=1 node scripts/run-vitest.mjs src/plugins/bundled-plugin-metadata.test.ts src/channels/plugins/bundled.shape-guard.test.ts src/channels/plugins/read-only.test.ts src/channels/plugins/bundled-root-caches.test.ts src/gateway/server.sessions.create.test.ts src/commands/doctor-heartbeat-session-target.test.ts src/auto-reply/reply/session.test.ts -t "dist-runtime|replaces a dead main entry|uses runtime session canonicalization|scoped WhatsApp group entry only contains activation state"pnpm exec oxfmt --check --threads=1 src/plugins/bundled-plugin-metadata.ts src/plugins/bundled-plugin-metadata.test.ts src/channels/plugins/bundled.ts src/channels/plugins/bundled.shape-guard.test.ts src/gateway/server.sessions.create.test.ts src/commands/doctor-heartbeat-session-target.test.ts src/auto-reply/reply/session.test.tsgit diff --checkpnpm check:changedReal behavior proof
Behavior or issue addressed:
Packaged bundled channel setup entries can resolve to
dist-runtime/extensions/<channel>/setup-entry.js, but the bundled channel loader only recognized override anddist/extensionsroots before falling back to sourceextensions/<channel>. That made the unchanged fs-safe module open check reject the setup entry as outside the selected plugin root, producingplugin module path escapes plugin root or fails alias checks.Real environment tested:
Ubuntu 24.04 WSL source checkout at
/root/src/openclaw-branches/baseon branchfix-telegram-setup-windows-77805, using focused source-level regressions that exercise the real bundled generated path resolver and the real bundled setup-entry load path with a temporary packageddist-runtime/extensions/alpha/setup-entry.jsmodule.Exact steps or command run after this patch:
CI=1 node scripts/run-vitest.mjs src/plugins/bundled-plugin-metadata.test.ts src/channels/plugins/bundled.shape-guard.test.ts -t "dist-runtime".Evidence after fix:
Before the production fix, the new regressions failed:
After this patch, the same regressions passed:
Observed result after fix:
The generated setup-entry path resolves from
dist-runtime/extensions, and the bundled channel setup loader checks that module against the matchingdist-runtime/extensions/<channel>boundary root. The existing fs-safeopenRootFileSynccontainment/alias validation remains the final enforcement point.What was not tested:
No native Windows host was available in this run. AWS Crabbox proof was attempted but blocked by Crabbox infrastructure before command execution: one script transport exited
127, one lease never bootstrapped SSH, and one lease lost SSH after sync. The source proof targets the reported packaged-root mismatch without relaxing the security boundary.