Repository navigation
fix(update): keep bundled plugin aliases bundled in candidate rehearsal - #143190
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. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 2:05 PM ET / 18:05 UTC (Revision 5). ClawSweeper reviewWhat this changesPreserve bundled-plugin trust during update rehearsal by redirecting verified path aliases to matching staged plugins, while retaining independent copies for external or unmatched entries. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main still loses bundled provenance during candidate copying. The previous fallback-root finding is resolved, and this review found no remaining actionable defects. Priority: P1 Review scores
Verification
How this fits togetherThe updater rehearses a staged OpenClaw release against isolated copies of configuration, databases, and installed plugins. Plugin discovery then determines which code the candidate Gateway loads and which trusted capabilities it receives. flowchart TD
A[Installed plugin paths] --> B[Verify physical bundled ownership]
C[Staged plugin inventory] --> D[Match plugin identity and entries]
B --> D
D -->|Verified match| E[Use staged bundled plugin]
D -->|External or unmatched| F[Copy plugin into isolated state]
E --> G[Candidate discovery and readiness]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +159, Tests +413, Docs +2. Total +574 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep candidate aliases bound to verified staged bundled code while preserving external-plugin restrictions and the serving installation's state. Do we have a high-confidence way to reproduce the issue? Yes: current-main copying moves a bundled path alias outside bundled roots, where discovery classifies it as an external path install. The supplied before/after regression demonstrates that transition; this review did not execute it. Is this the best way to solve the issue? Yes: repairing candidate projection preserves the existing trust contract without weakening runtime capabilities, changing live install records, or adding configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9865df7610c8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Keep proven bundled plugin path aliases bound to the matching staged plugin during candidate projection, preserving bundled origin and trust without changing external path-install policy. Refs #142633.
Admit package-owned source and candidate roots before fallback enumeration or permission repair. Preserve external path-install copying and prove valid and escaping fallback behavior. Refs #142633.
Reuse discovery entry enumeration and identity derivation for all bundled entry aliases. Preserve declaration/runtime pairing, keep missing candidate entries on the existing copy path, and redirect package roots only when all entries match one candidate package. Refs #142633.
66b6261 to
f02b548
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…al (openclaw#143190) * fix(update): preserve bundled aliases in candidate rehearsal Keep proven bundled plugin path aliases bound to the matching staged plugin during candidate projection, preserving bundled origin and trust without changing external path-install policy. Refs openclaw#142633. * fix(update): admit only contained fallback roots to bundled discovery Admit package-owned source and candidate roots before fallback enumeration or permission repair. Preserve external path-install copying and prove valid and escaping fallback behavior. Refs openclaw#142633. * fix(update): redirect every entry of multi-entry bundled plugins Reuse discovery entry enumeration and identity derivation for all bundled entry aliases. Preserve declaration/runtime pairing, keep missing candidate entries on the existing copy path, and redirect package roots only when all entries match one candidate package. Refs openclaw#142633.
Refs #142633
Additional instructions
Maintainers can update this same-repository branch.
What Problem This Solves
Fixes an issue where users running
openclaw updatewith path-install aliases of bundled plugins can have the candidate Gateway reject a plugin that the serving Gateway loads as bundled. This can prevent candidate readiness and block the update.Why This Change Was Made
Copying a bundled alias into independent storage changed discovery to
origin=globalandtrust.reason=origin-path. Candidate projection now redirects only physically verified bundled plugin roots and entrypoints to the staged bundled plugin with the same manifest ID, using runtime directory selection for source-checkout and split-runtime layouts.Source metadata inspection stays read-only, and candidate containment is checked before discovery. External paths, escaping aliases, and absent or mismatched staged plugin IDs retain the existing independent-copy path and trust policy. Install-record source values are unchanged.
User Impact
Candidate rehearsal preserves bundled ownership for these aliases while keeping external path installations subject to their existing trust restrictions. Live plugin files, permissions, install records, and host links remain untouched. The update workflow documentation describes this behavior.
Evidence
The regression runs the real rehearsal snapshot worker and then real manifest discovery against synthetic plugin packages and SQLite state. With the production fix temporarily reversed against the branch base, the directory-alias regression fails with:
The repaired regression matrix covers direct and symlink aliases, entrypoints, renamed staged directories, split runtime and source-checkout layouts, external paths, source/candidate symlink escapes, absent/mismatched IDs, and preservation of live permissions and database bytes. A separate before/after regression proves a candidate bundled-root symlink cannot change permissions outside the staged package during projection.
Focused validation: 205 tests passed across 9 files, including a real built Gateway reaching started/ready and verified process-group/state cleanup. The test runner rebuilt the final runtime successfully. The final provenance-only rerun passed all 13 cases; changed-file checks, including production/test typechecks and lint, also passed.
CI completed on
66b62610dace56cdfa1466523d35285bef0aca88with 131 checks passed and 50 skipped. CI is not green: checks-node-changed-extensions-bundle-27 failed in the unchangedextensions/telegram/src/model-callback.loopback.integration.test.ts:245, receivingHttpError: Network request for 'editMessageText' failed!; the aggregateopenclaw/ci-gateconsequently failed too. This test exercises the Telegram callback router against a local HTTP server and does not invoke candidate projection. This branch changes no Telegram files; the failure is recorded for separate follow-up.Known Gaps
This repairs the reproduced bundled-alias projection defect. The earlier snapshot ENOENT, unexplained npm canary exits, and isolated xAI repair-auth failure reported in #142633 remain unresolved. The synthetic proof does not establish that every reported update failure has this cause, so this PR references the issue rather than closing it.
Credit
Reported by @DonnieFi in #142633.
Review notes
Live persisted state and install records remain untouched. There are no persisted-state, install-record, or config schema changes. Candidate projection redirects only aliases whose realpaths belong to the running package's bundled roots and whose discovery identity and entry name match a staged bundled entry. External path installs retain their existing copy and trust behavior.
The accepted fallback-root finding is repaired at the scan owners: source and candidate fallback roots are admitted before enumeration, diagnostics, or permission repair, and source metadata loading also checks package containment. The accepted multi-entry finding is repaired by sharing discovery's runtime entry enumeration, ID derivation, and collision handling. Declared and runtime paths stay paired; unmatched entries keep the existing copy path. A whole-package alias redirects only when every entry matches one candidate package.
The original 13 regression cases are: directory; source permissions; symlink; entrypoint; renamed candidate directory; split candidate runtime; source checkout alongside built runtime; external path; source symlink escaping the bundled directory; candidate symlink escaping the bundled directory; candidate bundled root escaping the package; missing candidate ID; mismatched candidate ID.
Added coverage: valid in-package candidate fallback; escaping candidate fallback; escaping candidate fallback with an external install; no enumeration of an outside source fallback; no enumeration of an outside candidate fallback; complete multi-entry redirect; and a missing candidate entry with matching siblings preserved. The fallback regressions failed before the containment fix, and both multi-entry regressions failed before the entry-mapping fix. All 20 provenance cases now pass. The requested suites plus shared entry-resolver consumer tests passed 262 tests across 12 files; changed-file checks passed before rebase.
The three-commit series was rebased without conflicts onto main containing #143197 and #143213.
git range-diffreports all three patches unchanged; no hunk changed beyond rebase offsets.Post-rebase
node scripts/check-changed.mjspassed onf02b5484e8ab6f385e6ba98e7268b5e5e74e3fb5. The earlier CI failure above describes the old head; this head includes the Telegram and Windows fixture fixes from main and received a fresh CI run.Fresh exact-head CI passed on
f02b5484e8ab6f385e6ba98e7268b5e5e74e3fb5: run 34380528777.node scripts/watch-pr-ci.mjs 143190 f02b5484e8ab6f385e6ba98e7268b5e5e74e3fb5exited successfully withSTATUS state=SUCCESS pending=0andGREEN; no rerun was needed. ClawSweeper's exact-head review found no actionable findings or remaining Before merge items, and the requested re-review comment has been posted.