Skip to content

fix(plugins): relink host runtime dependencies - #117408

Merged
vincentkoc merged 4 commits into
mainfrom
fix-plugin-host-dependency-link-20260801
Aug 1, 2026
Merged

vincentkoc merged 4 commits into
mainfrom
fix-plugin-host-dependency-link-20260801

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Full release validation on main failed the plugin prerelease Docker lanes after @openclaw/[email protected] installed successfully but was reported as missing its declared openclaw runtime dependency. Managed npm roots intentionally remove nested OpenClaw packages, but the repair path only recreated host links for peerDependencies. The same dependency-health projection also falsely marked bundled plugins as broken even though their runtime dependencies are internalized into the packaged host.

Failed evidence:

What Changed

  • Treat openclaw declared in either dependencies or peerDependencies as a host-link contract in managed npm installs and repair flows.
  • Allow the installed dependency scanner to skip that link only after resolving it to the trusted OpenClaw host root; untrusted outside-root links still fail closed.
  • Stop applying package-local dependency health to bundled plugins, whose dependencies are validated and internalized by the package build.
  • Add changelog coverage for the operator-visible repair.

Evidence

  • node scripts/run-vitest.mjs src/plugins/plugin-peer-link.test.ts src/plugins/install-security-scan.runtime.test.ts src/plugins/status.dependency-health.test.ts src/plugins/status.registry-snapshot.test.ts — 4 files, 37 tests passed.
  • pnpm test:docker:kitchen-sink-plugin — full npm latest install/conformance/adversarial/update matrix passed on Blacksmith Testbox.
  • pnpm test:docker:kitchen-sink-rpc — external plugin RPC walk passed on the same Testbox lease.
  • Targeted oxfmt, oxlint, and git diff --check passed.
  • Branch autoreview: clean, no accepted P0/P1 findings.

@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 1, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 1, 2026 12:55
@vincentkoc
vincentkoc force-pushed the fix-plugin-host-dependency-link-20260801 branch from e19a5c5 to 30fc752 Compare August 1, 2026 13:00
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 9:23 AM ET / 13:23 UTC.

ClawSweeper review

What this changes

The PR repairs managed npm plugin installation by linking the packaged OpenClaw host when a plugin declares openclaw in either dependencies or peerDependencies, while preserving trusted-link scanning and bundled-plugin diagnostics.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This member-authored PR remains necessary: current main still repairs and audits only peer-declared host links, while the branch also covers runtime-declared openclaw links and stops false bundled-plugin dependency failures. The prior review findings are addressed; no new actionable patch defect was found, but the branch is behind main and required exact-head checks were still running.

Priority: P2
Reviewed head: f13a4a68a4a0bf43d5ac6c3bc6386f8453eb4ade

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-backed repair with reported real-environment coverage and no identified correctness finding; it is awaiting normal exact-head CI completion and maintainer review.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: This member-authored PR is not subject to the external-contributor proof gate; its body nevertheless records relevant after-fix Testbox Docker and external-plugin RPC validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR is not subject to the external-contributor proof gate; its body nevertheless records relevant after-fix Testbox Docker and external-plugin RPC validation.
Evidence reviewed 7 items Current-main gap: Current main reads only peer dependencies for the installed-package host-link repair and does not cover a plugin that declares openclaw under runtime dependencies.
Canonical repair path: The branch centralizes the manifest decision to the openclaw declaration and uses it for relinking and audit flows, preserving one host-link contract for both supported declaration forms.
Security boundary: The dependency scanner permits an out-of-root openclaw link only for the managed-root mode after resolving it beneath the trusted host package root; the added tests accept the trusted link and reject an arbitrary outside-root target.
Findings None None.
Security None None.

How this fits together

External plugins are installed under a managed npm root and need a local link to OpenClaw’s packaged runtime so their SDK imports resolve. Installation repair, dependency-tree scanning, and plugin status reporting consume that installed package structure and expose failures to operators.

flowchart LR
  A[Plugin package manifest] --> B[Managed npm plugin root]
  B --> C[Host runtime link repair]
  C --> D[Trusted dependency scan]
  D --> E[Plugin loading]
  E --> F[Operator diagnostics]
  G[Bundled plugin artifacts] --> F
Loading

Before merge

  • Resolve merge risk (P1) - The PR is mergeable but behind current main, and required exact-head checks were still in progress; refresh it against current main and merge only after those checks complete successfully.
  • Complete next step (P2) - The patch has no concrete repair finding, but this member-authored and maintainer-labeled PR should stay open for ordinary maintainer review after its pending exact-head checks finish.
Agent review details

Security

None.

PR surface

Source +29, Tests +134. Total +163 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 7 65 36 +29
Tests 4 135 1 +134
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 200 37 +163

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/plugins/install-security-scan.runtime.test.ts, serialized state: src/plugins/plugin-peer-link.test.ts, serialized state: src/plugins/plugin-peer-link.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the single managed-plugin host-link contract after exact-head CI succeeds: runtime and peer declarations should resolve only to the trusted packaged host, while bundled plugins should be diagnosed from their packaged artifact rather than package-local install state.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the single managed-plugin host-link contract after exact-head CI succeeds: runtime and peer declarations should resolve only to the trusted packaged host, while bundled plugins should be diagnosed from their packaged artifact rather than package-local install state.

Do we have a high-confidence way to reproduce the issue?

Yes: current main only detects openclaw in peer dependencies, while a managed plugin declaring it in dependencies follows the same missing-host-link path; the branch adds focused regression coverage for that source-proven case.

Is this the best way to solve the issue?

Yes: extending the existing shared host-link repair and trusted dependency-scan path is the narrowest maintainable fix, rather than adding package-manager-specific fallbacks or weakening the scanner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2576d844c436.

Labels

Label justifications:

  • P2: This corrects a real managed-plugin installation and operator-diagnostic regression with a bounded external-plugin blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored PR is not subject to the external-contributor proof gate; its body nevertheless records relevant after-fix Testbox Docker and external-plugin RPC validation.

Evidence

What I checked:

  • Current-main gap: Current main reads only peer dependencies for the installed-package host-link repair and does not cover a plugin that declares openclaw under runtime dependencies. (src/infra/package-update-utils.ts:47, 2576d844c436)
  • Canonical repair path: The branch centralizes the manifest decision to the openclaw declaration and uses it for relinking and audit flows, preserving one host-link contract for both supported declaration forms. (src/plugins/plugin-peer-link.ts:47, f13a4a68a4a0)
  • Security boundary: The dependency scanner permits an out-of-root openclaw link only for the managed-root mode after resolving it beneath the trusted host package root; the added tests accept the trusted link and reject an arbitrary outside-root target. (src/plugins/install-security-scan.runtime.ts:385, f13a4a68a4a0)
  • Bundled-plugin diagnostic behavior: Both live status reporting and registry snapshots now omit package-local dependency health for bundled origins, with focused regressions asserting that a bundled plugin remains loaded without a false diagnostic. (src/plugins/status.ts:319, f13a4a68a4a0)
  • Prior-review continuity: The latest commit changes the recovery diagnostic from peer-specific wording to neutral dependency wording, resolving the prior P3 finding without reintroducing the removed release-owned changelog change. (src/plugins/install-shared.ts:37, f13a4a68a4a0)
  • Area history: Plugin installation was substantially refactored in commit 3eb8b3a0f8383bd668ab6e14196dbc0590d56749, and shortlog history across the affected plugin files identifies Peter Steinberger and Vincent Koc as the strongest available routing candidates. (src/plugins/install-managed-npm.ts:1, 3eb8b3a0f838)

Likely related people:

  • Peter Steinberger: History shows the major plugin-installation-flow refactor, and shortlog activity is highest across the central plugin installation, scanner, and status files. (role: feature owner; confidence: high; commits: 3eb8b3a0f838, 416d8084bceb; files: src/plugins/install-managed-npm.ts, src/plugins/install-installed-package.ts, src/plugins/status.ts)
  • vincentkoc: The current repair is authored by this contributor, and feature-history shortlog data shows sustained work across the affected plugin files beyond this branch. (role: recent area contributor; confidence: medium; commits: 57a8ef67b2b1, f13a4a68a4a0; files: src/plugins/plugin-peer-link.ts, src/plugins/install-security-scan.runtime.ts, src/plugins/status-snapshot.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase or refresh against current main if required, then merge after the pending required checks succeed.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-01T13:05:57.888Z sha 30fc752 :: needs changes before merge. :: [P2] Remove the release-owned changelog entry
  • reviewed 2026-08-01T13:14:22.891Z sha 19c1aea :: needs changes before merge. :: [P3] Describe both supported host-link declaration types

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 1, 2026
@vincentkoc
vincentkoc merged commit 355295b into main Aug 1, 2026
120 checks passed
@vincentkoc
vincentkoc deleted the fix-plugin-host-dependency-link-20260801 branch August 1, 2026 13:27
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* fix(plugins): relink host runtime dependencies

* fix(plugins): remove stale peer helper

* chore(release): leave changelog ownership unchanged

* fix(plugins): clarify host link recovery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant