Repository navigation
fix(plugins): archive updates fail on development-only dependencies - #143350
fuller-stack-dev merged 9 commits into
Conversation
Co-authored-by: Copilot <[email protected]>
|
🦞👀 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 19, 2026, 9:06 AM ET / 13:06 UTC (Revision 8). ClawSweeper reviewWhat this changesThe PR isolates archive dependency installation from development packages and duplicate OpenClaw hosts, restores original package metadata, and extends host-link and cleanup coverage. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main. The updated published-updater and archive-repair evidence resolves the previous proof blocker; no actionable patch defects remain. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s plugin installer stages downloaded archives, installs runtime dependencies, validates the result, and publishes the replacement. Core updates and update repair use this installer to refresh managed plugins while retaining the previous installation on failure. flowchart TD
A[Plugin archive] --> B[Staged package]
B --> C[Temporary runtime manifest]
C --> D[Script-disabled npm install]
D --> E[Restore metadata and validate host link]
E --> F{Installation succeeds}
F -->|Yes| G[Publish replacement]
F -->|No| H[Retain previous plugin]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +43, Tests +201, Other 0. Total +244 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep dependency isolation inside the staged installer, preserving original metadata, existing-host links, and transactional recovery. Do we have a high-confidence way to reproduce the issue? Yes: an archive with runtime dependencies and an unavailable development-only package reaches npm with that development declaration on current main, where omission still performs resolution. Source and supplied before/after evidence establish the path; this review did not execute it. Is this the best way to solve the issue? Yes: temporary staging changes repair the existing installer without creating another dependency owner, and the updated proof covers fresh installs, replacement, failure preservation, and published-updater recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 43e41b26ec7b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Co-authored-by: Copilot <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…143350) * fix(plugins): isolate npm manifest resolution * fix(plugins): preserve hook host dependencies * test(plugins): align npm isolation coverage with CI limits * fix(plugins): link optional-only OpenClaw host dependencies * test(gateway): settle companion databases before fixture cleanup * test(plugins): cover optional hosts in native import preparation * test(skills): close status watchers before retiring fixture roots --------- Co-authored-by: Gio Della-Libera <[email protected]> Co-authored-by: Jason (Json) <[email protected]> (cherry picked from commit cbf935b)
* fix(update): restore Gateway after partial stop failure Adapt the service-mutation recovery invariant to the 2026.8 updater owner. (cherry picked from commit ad682b4) * fix(update): replace unsupported service Node runtimes Adapt the recorded-service runtime probe to the 2026.8 daemon install plan. (cherry picked from commit fe79d36) * fix(gateway): gateway stays offline after agent restart on Windows (#134549) * fix(gateway): keep agent restart alive on Windows * docs(gateway): clarify Windows agent restart routing --------- Co-authored-by: Josh <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit 3a0a623) * fix: published Linux upgrades leave unchanged gateways stopped (#151049) * fix(update): preserve service fingerprints across published upgrades Keep known-empty systemd override metadata out of the fingerprint retained by published updaters through 2026.9.4. Preserve full command metadata for runtime pinning and reject actual protected service changes. * test: group silence failures with error payload coverage Keep the required sealed-answer fixture field while moving its related failure-policy cases into the existing error payload test module. Preserve every case and assertion without growing the over-cap payload test file. (cherry picked from commit 4475640) * fix(doctor): preserve explicitly configured profile workspaces (#145976) * fix(doctor): preserve configured profile workspaces * fix(doctor): avoid assuming workspace ownership Co-authored-by: ericcaiwx-star <[email protected]> (cherry picked from commit 1e8ba48) * fix(plugins): stop relocated install records from shadowing bundled plugins (#144843) * fix(plugins): stop relocated install records from shadowing bundled plugins A `path` install record stores an absolute directory. When that directory is another OpenClaw installation's bundled plugin tree, the record survives the installation move and is rediscovered as an `origin: "global"` candidate. `global` outranks `bundled`, so the stale pin won the duplicate-id contest and the plugin resolved from the old installation. `resolvePluginTrust` then saw `record.source === "path"` and downgraded it to `origin-path`, which revokes trusted plugin state and fails trusted-only APIs mid-turn. `isIntentionalInstalledBundledDuplicate` also suppressed the duplicate warning, because installed-shadows-bundled is normally deliberate, so the swap was silent. Treat a plugin directory inside a *different* installation's bundled roots as stale: it no longer outranks the current bundled copy, and it no longer counts as an intentional shadow, so the existing duplicate warning reports it. * fix(plugins): name the stale install record instead of a generic duplicate The duplicate-id warning reported "global plugin will be overridden by bundled plugin", which describes the mechanism but gives an operator nothing to act on. A pin into another installation's bundled tree is a stale record rather than a deliberate override, so report it as one and name the remedy. * docs(agents): record that a stored absolute path is not provenance The stale-pin defect this branch fixes came from a persisted absolute path that kept conferring bundled status after the installation it named was replaced. Record the invariant so the next record type does not repeat it. * fix(plugins): narrow the stale-pin gate to relocated compiled trees Review of the preceding guard found two ways it misfired. It answered "foreign" by negating a membership test against the running package roots, so an install whose root resolves from neither argv nor the module URL saw every bundled tree as foreign, including its own. Compiled sibling trees and the module walk-up fallback resolve exactly that way, so the gate now fails open when the running root is unknown. It also accepted `<root>/extensions/<id>`, the documented `plugins install --link` development target, which made a deliberate local override report as a stale record and told the developer to delete it. Only compiled `dist`/`dist-runtime` trees travel with an installation, so the shape check is limited to those, and a plugin inside the configured dev source root is excluded at the call site, where importing it raises no cycle. * test(auth): pin external credential refresh timing (#152771) --------- Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit 5ec3614) * fix(plugins): archive updates fail on development-only dependencies (#143350) * fix(plugins): isolate npm manifest resolution * fix(plugins): preserve hook host dependencies * test(plugins): align npm isolation coverage with CI limits * fix(plugins): link optional-only OpenClaw host dependencies * test(gateway): settle companion databases before fixture cleanup * test(plugins): cover optional hosts in native import preparation * test(skills): close status watchers before retiring fixture roots --------- Co-authored-by: Gio Della-Libera <[email protected]> Co-authored-by: Jason (Json) <[email protected]> (cherry picked from commit cbf935b) * fix(gateway): release agent leases when shutdown completes (#151435) Drain the existing agent database lifecycle during final Gateway retirement before shared state closes. Preserve sibling ownership and surface native-close failures without dropping their lease. Four new regressions fail on the original code. The repair passes 92 focused cases and an isolated four-case rerun, changed checks, and independent P0-P2 review. (cherry picked from commit 3381de9) * fix: restore Gateway restarts after Git updates (#138781) * fix: restore Gateway restarts after Git updates * test: align update installer mock with eager import (cherry picked from commit 24d8119) --------- Co-authored-by: josh <[email protected]> Co-authored-by: Josh <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Eric Cai <[email protected]> Co-authored-by: Gio Della-Libera <[email protected]> Co-authored-by: Gio Della-Libera <[email protected]> Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: Jason O'Neal <[email protected]>
…penclaw#143350) * fix(plugins): isolate npm manifest resolution * fix(plugins): preserve hook host dependencies * test(plugins): align npm isolation coverage with CI limits * fix(plugins): link optional-only OpenClaw host dependencies * test(gateway): settle companion databases before fixture cleanup * test(plugins): cover optional hosts in native import preparation * test(skills): close status watchers before retiring fixture roots --------- Co-authored-by: Gio Della-Libera <[email protected]> Co-authored-by: Jason (Json) <[email protected]>
What Problem This Solves
ClawHub plugin archive refreshes can fail when npm resolves unavailable development-only packages or attempts to install a second OpenClaw host, even with
--omit=dev.User Impact
Post-core updates can refresh these plugins while preserving their original package metadata. Failed dependency installation leaves the previous plugin intact with an actionable npm diagnostic. Hook packs continue to install their declared OpenClaw runtime dependency.
Why This Change Was Made
The staged installer temporarily removes development dependencies for npm resolution. Plugin installs also omit OpenClaw host declarations, including optional dependencies, and use the existing audited host link. The shared host-declaration resolver also recognizes optional-only host declarations, so fresh installs, archive replacements, and later repair all retain the existing-host link. Other runtime dependencies and peers remain unchanged. npm ignores enclosing workspace discovery. Exact original manifest bytes are restored before validation, transaction settlement, or failure cleanup; consent and lifecycle ownership checks remain in place.
This continues @giodl73-repo's original fix and preserves its contributor ancestry, adapted to the current deferred-install transaction.
Evidence
Focused installer, manifest-settlement, and hook tests: 31 passed. The original regression failed on pinned main; the optional-host review finding failed its three targeted cases before repair.
Real ClawHub-compatible HTTP archive fixture through
convergePluginReleaseCohort, the post-core cohort owner, with actual npm: version 1.0.0 → 2.0.0, usable runtime dependency, byte-exact manifest restoration, existing-host symlink, trust/consent checks, and settled backup contents.Actual npm failure from a missing dependency tarball: original plugin and manifest retained, npm diagnostic preserved, staging removed.
The same archive update on pinned main failed while attempting to resolve a private OpenClaw host. This is isolated archive/cohort acceptance, not a live production update.
Earlier published
@expediagroup/[email protected]tarball and npm workspace-isolation qualification remains retained historical evidence; it was not replayed or counted as post-core acceptance.CI follow-up: hook install/update coverage is consolidated into the existing suite (36 passed), and the shard boundary tests passed (24). The exact npm-argument assertion includes workspace isolation; unchanged ZIP fixture builders live in a test-support module to preserve the line limit without adding a test root.
Hosted review found an optional-only host-link gap. Five added cases and a real archive replacement reproduced it before repair. The repaired installer/link/payload suites pass 186 tests; optional-only fresh installation and archive replacement also pass with real npm, exact manifest bytes, usable runtime dependencies, the existing-host symlink, native SDK export resolution, and settled staging. The source fixture does not execute a built SDK artifact.
Native source preparation now covers optional-only host declarations in its ESM/CommonJS import matrix: 23 passed, with both optional cases failing against the pre-repair resolver. Preparation does not execute plugin code or rebuild existing artifacts.
Main integration adopts the shared companion database cleanup already landed in test(gateway): join companion database cleanup before removal #152780, replacing the equivalent local fixture-only repair. Both the companion fixture and shared cleanup-helper suites pass (23 tests). All 14 remaining candidate files are byte-identical to their reviewed versions.
Independent API-only review found no actionable P0–P2 findings in the manifest fix, test corrections, or optional-host linking repair.
CI timer cleanup: a worker-local trace identified real skills-status watchers escaping the install fixture. The fixture now awaits the existing watcher owner before restoring its roots. The same 165-file Linux reproducer changes the two failing diagnostics cases to passes (all 10 diagnostics pass); the four source-archive/root-environment failures are not counted as CI success. Static checks and API-only review pass.
Exact-head CI passed for
72d8dc6389724310e31d739d518e5a86dbda558a; current CI, dependency-review, and security-review gates pass. The immutable package artifact was verified by service ZIP digest, package SHA-256, and embedded source commit.Published-driver/archive acceptance: published OpenClaw 2026.9.5 installed that exact candidate through
openclaw update. The interrupted fixture initially resumed at a different HTTP port; the updater correctly warned and retained plugin 1.0.0 at its persisted registry URL. Restoring that endpoint and running the supportedopenclaw update repair --yes --json --no-restartcompleted the actual post-core ClawHub archive path: 1.0.0 → 2.0.0, byte-exact original manifest, usable runtime dependency, existing-host symlink, and 66 exports loaded from the built SDK. Core and baseline installations were not repeated. This proves the recovered update/repair flow, not an uninterrupted first-attempt archive update or live production update.The separate generic Package Acceptance run is failed, not counted as passing: its unchanged missing-load-path fixture expected the source entry URL, while the published baseline loaded a built plugin URL. It stopped before invoking the candidate updater. Package integrity and npm 12 installer acceptance passed. The task-specific published-driver and archive-repair proof above supplies the missing relevant product coverage without weakening that generic assertion. The first dispatch failed source admission; an obsolete conflicting-head dispatch was cancelled.