Repository navigation
fix(update): preserve config when plugin load paths are unavailable - #150312
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: blocked before merge. Reviewed September 16, 2026, 7:35 PM ET / 23:35 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch preserves settings for unavailable plugin load paths, carries actionable warnings through Doctor and updates, and adds upgrade coverage with shared harness paths. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful, distinct fix for the discovery gap left by the earlier merged work. No actionable introduced defect was found, and the supplied upgrade evidence addresses the previous compatibility concern. Priority: P2 Review scores
Verification
How this fits togetherPlugin discovery translates configured filesystem paths into plugin metadata used by validation, Doctor repairs, and Gateway startup. The updater consumes Doctor findings to decide whether a candidate can continue and which warnings to report. flowchart TD
A[Configured plugin paths] --> B[Plugin discovery]
B --> C{Path inspectable?}
C -->|Yes| D[Plugin metadata]
C -->|No| E[Warning and preserve settings]
D --> F[Validation and Doctor]
E --> F
F --> G[Update readiness and report]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +273, Tests +723, Docs +18, Other +250. Total +1264 across 54 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep discovery-owned preservation facts intact through repair and reporting so unavailable optional plugins do not invalidate otherwise usable updates. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the trigger: configure a missing plugin load path and run candidate validation on current main. This read-only review did not execute OpenClaw; the PR supplies separate runtime observations. Is this the best way to solve the issue? Yes. Recording preservation independently from severity fixes the update rejection without letting stale-config cleanup discard settings whose owner could not be inspected. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 04ce86783632. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
e40aaaf to
4f34d44
Compare
|
Merged via squash.
|
Apply the repository formatter to the two test conditions left unformatted by openclaw#135276 (18dcf28), which broke check-docs formatting checks on unrelated PRs openclaw#150306 and openclaw#150312. This changes line wrapping only.
…penclaw#150312) * fix: preserve unavailable plugin paths during updates Record a typed preserve disposition at discovery and retain it through the plugin index. Keep uninspected settings intact across validation, cleanup, migration, and automatic activation; carry the warning into Doctor and update readiness reports. Refs openclaw#150016 and openclaw#149960. * test: activate missing-path upgrade fixture at startup * fix(doctor): preserve unavailable bundled path aliases * test(update): keep base upgrade install on native storage * test(update): verify retained migration sources for unavailable plugins * fix(plugins): retain filesystem inspection failures during updates * test(doctor): require the inspection diagnostic before projection checks * style(doctor): avoid mapped spreads in inspection findings * test(update): follow survivor runtime and artifact paths * fix(doctor): preserve availability warnings through startup repair * test(e2e): share upgrade survivor installation paths
Let the verified anchor child complete and validate its package pins when an older parent hands it an incomplete dependency context. Preserve pinned real package directories and bootstrap older anchors against their own manifest. Extend the extracted-source guard to cover pinned bare imports, package export subpaths, and copied workspace aliases. Keep the inventory repair with #150399. Refs: #149585, #133913, #150312, #150399.
Let the verified anchor child complete and validate its package pins when an older parent hands it an incomplete dependency context. Preserve pinned real package directories and bootstrap older anchors against their own manifest. Extend the extracted-source guard to cover pinned bare imports, package export subpaths, and copied workspace aliases. Keep the inventory repair with #150399. Refs: #149585, #133913, #150312, #150399.
* fix(pr): give materialized wrappers their dependency context Let the verified anchor child complete and validate its package pins when an older parent hands it an incomplete dependency context. Preserve pinned real package directories and bootstrap older anchors against their own manifest. Extend the extracted-source guard to cover pinned bare imports, package export subpaths, and copied workspace aliases. Keep the inventory repair with #150399. Refs: #149585, #133913, #150312, #150399. * test(pr): resolve workspace aliases within the extracted root Bind the TypeScript resolution host to the selected closure root so alias lookups cannot fall back to the calling checkout during anchor validation. Refs: #150399, #150504.
…w#150504) * fix(pr): give materialized wrappers their dependency context Let the verified anchor child complete and validate its package pins when an older parent hands it an incomplete dependency context. Preserve pinned real package directories and bootstrap older anchors against their own manifest. Extend the extracted-source guard to cover pinned bare imports, package export subpaths, and copied workspace aliases. Keep the inventory repair with openclaw#150399. Refs: openclaw#149585, openclaw#133913, openclaw#150312, openclaw#150399. * test(pr): resolve workspace aliases within the extracted root Bind the TypeScript resolution host to the selected closure root so alias lookups cannot fall back to the calling checkout during anchor validation. Refs: openclaw#150399, openclaw#150504.
Related: #150016, #149960
What Problem This Solves
A missing configured plugin load path could reject an otherwise usable update candidate. The initial repair also mislabeled permission and filesystem inspection failures as missing paths, discarding the underlying error.
User Impact
Updates continue with an actionable warning and preserve uninspected plugin configuration. Missing paths and failed inspections now have distinct closed reasons, so operators can identify and repair the real failure.
configured-plugin-path-unavailableENOENT,ENOTDIR, or the existingnot-foundequivalent. Restore or correct the path, then runopenclaw doctor --fix.configured-plugin-path-inspection-failedEACCES,EPERM,EIO,ELOOP, unsupported filesystem entries, and errors without an errno. RetainerrorCodeand the error message; permission failures say to fix permissions on the affected path, then runopenclaw doctor --fix.Both reasons preserve configuration and remain warnings. No new config or CLI options, dependencies, SQLite schema/version changes, suppressions, or baseline increases.
Why This Change Was Made
Discovery owns classification and records
configDisposition: "preserve". The stat cache retains original failures, and configured directories are inspected before bundled provenance can replace their configured origin. The existing plugin-index codec, config warnings, Doctor JSON, update readiness, and update report retain the diagnostic reason and inspection details.None of these consumers distinguishes the two reasons or reclassifies filesystem errors. Both mean the configuration was not inspected and must remain intact.
The original rejection was at
discovery.ts:1171; a severity-only change exposed deletion atstale-plugin-config.ts:410. The accepted P1 follow-up fixes the unconditional availability classification atdiscovery.ts:1097.Application/runtime source (
src/**, excluding tests) is +528/−255 (net +273); harness/catalog +271/−21 (net +250); tests/support +821/−98 (net +723); docs +25/−7 (net +18). The inspection follow-up adds +116/−19 production (net +97) and 207 test lines. Growth carries typed diagnostics and preservation across the existing owners; the follow-up adds retained errno facts and their projections, without adding reason-specific mutation guards. Existing over-cap files did not grow.Evidence
Shared harness-path follow-up (
eab544677ce):artifacts/npm-prefix, while the base scenario installed underruntime/npm-prefix. Baseline setup therefore failed withENOENTbefore the update fault was exercised. The original test failed locally 6/6, matching the reported CI job.scripts/e2e/lib/upgrade-survivor/paths.shnow resolves the baseline package/bin paths and artifact/log paths once for the harness. Baseline fixtures execute that same resolver through a test adapter and consume its facts; the installed-version, manager/cleanup, and missing-load-path fixtures no longer recompute the layout.eab544677ceb38f9030215b83b3fe4a997ac3ac8: seven files, +133/−54 (net +79): harness +23/−16, tests/support +110/−38. Application production and docs are unchanged; no new autoreview was run under the requested scope.test/scripts/upgrade-survivor*.test.tsfiles plusdocker-build-helper.test.ts. The broad run passed 27 files and exposed five existing PR-owned setup failures inupgrade-survivor-baseline-order.test.ts: its sliced shell omitted the missing-path helper, and its manual base case skipped the seed phase required by session-source capture. That fixture now sources the real helper, executes the seed phase with the expected plugin containers, and consumes the shared paths; every registry-order and migration-row assertion remains intact. The corrected file passes 9/9, giving 970 passing tests across 28 files, with two Linux-only local skips, across the broad run and focused rerun. Linux Testbox proof passed all 10 selected cases: the six installed-version cases plus both manager and cleanup variants. The one-shot Testbox reportedexitCode=0and stopped; its temporary sync checkout was removed. Its verified treea19e2f36c3ad6163ce088aa096423c87963fbf09matches this revision except for the later baseline-order test-only correction, verified separately above.node scripts/check-changed.mjs -- <all seven changed files>passed, including root-test typechecking, script/test lint, Docker boundary/catalog checks, dependency guards, line-cap ratchet, and three unused-export scans with 0 entries. No extension-lint substitution was needed for this test/tooling-only change.bash -nandgit diff --checkalso passed.Rebased-head CI follow-up (
4f34d44ceb4):missing-load-path.mjswas only reached through a shell variable, leaving it invisible to the unused-file graph. The namedmissing-load-pathscenario now uses the existing assertion dispatcher with a literal import. It retains the existing base/manual row, native installation storage, and preserved-source checks. It is opt-in so aggregate coverage does not duplicate the base row. No Knip entry exceptions, ignores, or allowlists were added.automatic-startup-config-repair.test.ts:433. Under the ruling in fix: keep unavailable configured plugins from rolling back updates #150016/fix(update): preserve config when plugin load paths are unavailable #150312, core alias repair succeeds while the plugin config remains intact. The replacement real-file test verifies that result, untouched authored bytes during planning, and the typed warning. It exposed a real propagation gap: the planner discarded warnings from successful validation. The owner now includes them on its returned snapshot without changing its refusal predicate.doctor-config-preflight.admission.process.test.ts:207. It now requires exit 0, preserved plugin settings, a byte-identical backup of the authored config, the expected schema migration, andconfigured-plugin-path-unavailablein the resulting snapshot. Every other pre-existing file outside the intentionally migrated config/SQLite surfaces must retain its hash.enabled: "not-a-boolean"). Planning must returnnull; process admission must exit 78 with the whole state manifest and schema unchanged. Each availability case includes the requested ruling/reference comment.4f34d44ceb4: 11 files, +174/−14. Runtime owner: +4/−1; harness/catalog: +16/−7; tests: +154/−6.pnpm deadcode:dependencies,pnpm deadcode:unused-files, andpnpm deadcode:exportsall passed; production and full-tree unused-file scans both report 0 entries. The native changed-check plan passed, including core/core-test/tooling typechecks, lint, and 0 runtime import cycles. Fresh Codex autoreview (--mode branch --base origin/main --max-priority P1) is scoped-clean oneab544677ceb38f9030215b83b3fe4a997ac3ac8; it was rerun because the startup warning projection changed production code.CI follow-up on
feea64fffab:check-docsfailed inpnpm format:check, before any docs checks. Oxfmt wanted two expressions atsrc/scripts/ci-changed-scope.test.ts:872and:877on single lines. CI checked out merge4f83aa8308920f61d80c6358f930cbd03c640aedagainst base20230c35f018997ae72b562327dd370f44d43ffc(fix(plugins): keep unpublished packages bundled until release #150316); the bad formatting is already present in that base. This branch's file formats cleanly. No docs or foreign-owner code was changed for that inherited failure.checks-node-compact-small-32failed two cases intest/scripts/docker-build-helper.test.ts: “starts the published auth probe under the manager that owns its restart and stop” expected service status3but gotnullat line 3901; “collects before cleanup without masking failure or breaking success in scripts/e2e/lib/upgrade-survivor/run.sh” could not readartifacts/update.errat line 5194. Both tests still assumed the artifact-mounted npm prefix after this PR moved the base installation to native runtime storage. That round located the service shim under the runtime prefix and wrote diagnostic logs to the artifact owner directly. The shared harness-path follow-up above replaces those individual path selections with the harness-owned resolver; all behavioral assertions remain intact.feea64fffab: one test file, +4/−7; production and docs unchanged. The cleanup cases pass locally. Linux Testbox proof passed all 4 selected cases, including both manager probes, withexitCode=0; the verified tree93aef9acf026b5c4df3cdf697096acc5d9676ce8matches the new commit. The one-shot Testbox lease stopped successfully.node scripts/check-changed.mjs -- test/scripts/docker-build-helper.test.tspassed. Every docs-job command passed locally:pnpm format:check,pnpm config:docs:check,pnpm plugins:inventory:check, andpnpm check:docswith the ClawHub docs source. Results include 0 broken links and 1,242 validated config fences. The formatting issue inherited from CI's base is reported separately rather than changing an unrelated owner.62 focused tests passed: real chmod-000 directory and ancestor cases; errno classification; real cached symlink-loop failure; SQLite close/reopen; unchanged missing-path preservation; plugin cache and migration controls; update readiness.
The real permissions regression failed before the fix because the error was discarded:
It now verifies byte-identical authored config, the original error in Doctor lint, and the same specific warning/recovery in the update readiness report. Windows skips the chmod cases.
The classification cases deliberately use misleading
ENOENTmessage text with other errno values, proving classification depends on the code. An error with no code remains inspection-failed witherrorCode: "UNKNOWN".The full changed-check plan passed after correcting the new test's strict presence assertion and the mapped-object lint issue. The only substitution is the approved nested-checkout extension lint command; no other gate is skipped. The existing canary proof for that unchanged lint command is:
Command:
node_modules/.bin/oxlint --tsconfig test/tsconfig/tsconfig.extensions.test.json extensions. CI's extension-lint job remains authoritative.Fresh Codex autoreview (
--mode branch --base origin/main --max-priority P1) is scoped-clean onfeea64fffab88cb2fd8ca37a19a851cd614c38de.pnpm docs:listpassed.pnpm buildpassed on that head in 5m 38.7s, with zeroINEFFECTIVE_DYNAMIC_IMPORTwarnings. Import-cycle check: 0 runtime value cycles; all 154 public SDK subpaths verified.Earlier published 2026.9.3 → candidate Docker missing-path row passed using production artifact
17f995789fa8cd5142c786be84ebbaf0f9fbf514, before this inspection follow-up. Update returnedokin 204,741 ms, emittedconfigured-plugin-path-unavailable, preserved plugin-entry/load-path bytes through update and Doctor, and finished withreadyz.ready=trueandrpc.ok=true(23-second Gateway startup). The fixture also verified retained legacy-source hashes and canonical SQLite rows/transcripts. This follow-up uses the focused boundary proof and required build above; it does not claim a new Docker row.The Docker fixture uses container-native installation storage after the published driver hit its unchanged 30,004 ms verification timeout on a macOS bind mount. Its source-retention check follows the migration owner's verified-import contract; other scenarios still require source removal. Task containers, images, runtime installs, and tarball were cleaned up after that row.
Current head:
e827b7b1b07a48c46279a0ff625277de83e8f77b. The shared harness-path follow-up changes test infrastructure only and retains the previously reviewed plugin availability behavior.