Skip to content

fix(update): recognize bundle plugins in post-update payload smoke check (fixes #97985) (AI-assisted) - #97990

Closed
liuhao1024 wants to merge 3 commits into
openclaw:mainfrom
liuhao1024:fix/update-plugin-sync-bundle-false-failure
Closed

liuhao1024 wants to merge 3 commits into
openclaw:mainfrom
liuhao1024:fix/update-plugin-sync-bundle-false-failure

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw update fails on every format=bundle plugin (Claude-plugin layout: .claude-plugin/plugin.json + skills/, no package.json). The post-update payload smoke check requires package.json for all tracked plugins, so bundle plugins installed from ClawHub always produce a false missing-package-json failure. This causes the update to exit 1 and leaves the gateway unloaded — even though the bundle plugins are structurally valid and load fine at runtime.

Why This Change Was Made

Both runPluginPayloadSmokeCheck (in plugin-payload-validation.ts) and collectMissingPluginInstallPayloads (in update-command.ts) unconditionally check for package.json in each plugin's install directory. Bundle plugins from ClawHub (clawhubFamily: "bundle-plugin") use .claude-plugin/plugin.json instead, so they always fail this check.

The fix detects clawhubFamily === "bundle-plugin" records and validates .claude-plugin/plugin.json (existence + valid JSON) instead of package.json. This applies in both the smoke-check path and the missing-payload collector.

User Impact

Users with bundle plugins (common for Claude-plugin layout extensions) will no longer see false update failures. The gateway stays loaded after openclaw update instead of being unloaded by a spurious plugin-sync error.

Evidence

Real behavior proof

  • Behavior addressed: Post-update plugin payload smoke check false-failing on format=bundle plugins that lack package.json.
  • Environment tested: macOS Apple Silicon, OpenClaw 2026.5.28 (local dev checkout at 54b09580f).
  • Steps run after the patch:
    1. Created a temp bundle plugin directory with .claude-plugin/plugin.json (valid JSON).
    2. Created a temp bundle plugin directory without the manifest (broken).
    3. Created a temp npm plugin record pointing at a nonexistent directory.
    4. Ran runPluginPayloadSmokeCheck with all three records via a production import.
  • Evidence after fix:
=== Smoke Check Results ===
Checked: [ 'broken-bundle', 'my-bundle', 'npm-plugin' ]
Failures: [
  {
    "pluginId": "broken-bundle",
    "reason": "missing-package-json",
    "detail": "Bundle plugin manifest is missing: .../.claude-plugin/plugin.json"
  },
  {
    "pluginId": "npm-plugin",
    "reason": "missing-package-dir",
    "detail": "Install dir is missing: .../nonexistent"
  }
]

✅ All assertions passed:
  - Bundle plugin with .claude-plugin/plugin.json → PASS (no false failure)
  - Bundle plugin without manifest → correctly flagged
  - npm plugin with missing dir → correctly flagged
  • Observed result after fix: Bundle plugin with valid .claude-plugin/plugin.json passes the smoke check (no failure). Broken bundle plugin and missing npm plugin dir are still correctly flagged.
  • What was not tested: Full openclaw update end-to-end flow (requires a real version upgrade). Gateway restart after update.

Changes

  • src/cli/update-cli/plugin-payload-validation.ts: Added isBundlePluginRecord() helper; bundle plugins now validate .claude-plugin/plugin.json instead of package.json.

  • src/cli/update-cli/update-command.ts: collectMissingPluginInstallPayloads skips the package.json requirement for bundle plugins that have .claude-plugin/plugin.json.

  • src/cli/update-cli/plugin-payload-validation.test.ts: 3 new tests (bundle accepted, missing manifest flagged, unparseable manifest flagged).

  • src/cli/update-cli/update-command.test.ts: 2 new tests (bundle not flagged when manifest present, flagged when manifest missing).

  • AI-assisted (Hermes Agent)

Bundle plugins (clawhubFamily=bundle-plugin) use .claude-plugin/plugin.json
instead of package.json. The post-update payload smoke check and missing-
payload collector both required package.json, causing false failures for
every bundle plugin during openclaw update. This exited 1 and left the
gateway unloaded despite the plugins being structurally valid.

Fix: detect clawhubFamily=bundle-plugin records and validate the bundle
manifest (.claude-plugin/plugin.json) instead of package.json.

Fixes openclaw#97985
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Jun 30, 2026
@clawsweeper

clawsweeper Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 12:33 AM ET / 04:33 UTC.

Summary
The branch makes post-update plugin payload validation accept ClawHub bundle-plugin installs without package.json by checking shared bundle manifests, with focused regression tests.

PR surface: Source +52, Tests +166. Total +218 across 4 files.

Reproducibility: yes. Current main source still sends tracked install records without package.json to missing-package-json, and the linked issue reports the released 2026.6.10 failure for active bundle-format plugins.

Review metrics: 1 noteworthy metric.

  • Update payload gates changed: 2 changed. Both the post-core smoke check and the missing-payload collector can decide whether valid plugin installs block update completion.

Stored data model
Persistent data-model change detected: serialized state: src/cli/update-cli/plugin-payload-validation.test.ts, serialized state: src/cli/update-cli/update-command.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #97985
Summary: This PR is one candidate fix for the canonical bundle-plugin update false-failure issue, with several sibling PRs attempting the same repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

  • [P1] The changed checks sit before the gateway restart path, so a wrong bundle/native classification can still turn an update into an availability problem.
  • [P1] The PR proof exercises production payload-check functions but not a full packaged openclaw update plus gateway restart flow.
  • [P1] Several open PRs target the same issue, so maintainers should choose one canonical fix branch before landing.

Maintainer options:

  1. Accept Targeted Proof For This Branch (recommended)
    Maintainers can accept the production-function proof and clean CI for this narrow updater repair, then land this branch as the canonical fix.
  2. Ask For Packaged Update Proof
    Maintainers can require a full openclaw update plus gateway restart proof before merge because this check gates post-update availability.
  3. Choose A Sibling Candidate
    If another open candidate becomes preferred, close or supersede this PR only after the replacement is clearly merge-ready or merged.

Next step before merge

  • [P2] No narrow automated repair remains; the remaining action is maintainer selection of the canonical PR and acceptance of the update-availability proof level.

Security
Cleared: No concrete security or supply-chain regression was found; the diff reads local plugin manifests and adds tests without changing dependencies, workflows, permissions, or secret handling.

Review details

Best possible solution:

Land one canonical bundle-aware updater fix that preserves native package validation and validates true bundle-only payloads through the shared bundle manifest contract.

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

Yes. Current main source still sends tracked install records without package.json to missing-package-json, and the linked issue reports the released 2026.6.10 failure for active bundle-format plugins.

Is this the best way to solve the issue?

Yes for the reported ClawHub bundle-plugin path. The patch fixes the two implicated updater payload gates with the existing bundle manifest contract while keeping native package validation intact.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 85ee71223f0d.

Label changes

Label justifications:

  • P1: The PR targets a released update workflow that can exit before gateway recovery for valid active bundle plugins.
  • merge-risk: 🚨 compatibility: The diff changes upgrade-time classification of persisted ClawHub plugin install records.
  • merge-risk: 🚨 availability: The validation result controls whether the updater reaches the gateway restart path after a package update.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output from production payload-check imports covering valid bundle, broken bundle, and npm failure paths; full packaged update proof remains optional maintainer assurance.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from production payload-check imports covering valid bundle, broken bundle, and npm failure paths; full packaged update proof remains optional maintainer assurance.
Evidence reviewed

PR surface:

Source +52, Tests +166. Total +218 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 53 1 +52
Tests 2 166 0 +166
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 219 1 +218

What I checked:

Likely related people:

  • RomneyDa: Current blame for the updater smoke check and missing-payload collector lines points to the merged ClawHub packaged plugin QA evidence commit. (role: current-line carrier; confidence: medium; commits: beab0ecb02dd; files: src/cli/update-cli/plugin-payload-validation.ts, src/cli/update-cli/update-command.ts, src/cli/update-cli/post-core-plugin-convergence.ts)
  • steipete: History shows the native ClawHub install flow that persists package-family metadata was added in the ClawHub install feature work. (role: ClawHub install-flow contributor; confidence: medium; commits: 91b2800241c1; files: src/plugins/clawhub.ts, docs/cli/plugins.md)
  • vincentkoc: History shows several Claude-compatible bundle manifest and capability updates in src/plugins/bundle-manifest.ts and related docs. (role: bundle support contributor; confidence: medium; commits: b9b891b614fd, 50a81c873101, d896d8e0cd19; files: src/plugins/bundle-manifest.ts, docs/cli/plugins.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 30, 2026
Replace hard-coded .claude-plugin/plugin.json path with
detectBundleManifestFormat() + loadBundleManifest() to cover
all supported bundle formats (Codex, Cursor, Claude, manifestless
Claude) in the post-update smoke check and missing-payload collector.

Add regression tests for .codex-plugin and .cursor-plugin formats.
…gin installs

Check for a valid native package.json before treating a bundle-family
install record as bundle-only. Dual-format directories (native package
metadata plus bundle markers) should use the native validation path per
the bundle docs contract.
@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 Jun 30, 2026
@harjothkhara

Copy link
Copy Markdown
Contributor

I did a source pass over the #97985 sibling PRs and this looks like the safest candidate to keep as the canonical fix.

The important part is that this branch handles both update-time gates from the report: collectMissingPluginInstallPayloads stops treating true ClawHub bundle-plugin payloads as missing-package-json, and runPluginPayloadSmokeCheck validates those same bundle payloads through the shared bundle manifest path instead of the npm package path. It also preserves the native-first contract: when a top-level package.json exists, the smoke check continues through normal package/extension/main/peer validation before any bundle-only path can matter. That avoids the dual-format bypass risk present in some sibling attempts.

I would still let maintainers decide whether production-function proof is enough for this update-availability path or whether they want one packaged openclaw update plus gateway restart proof, but I did not find a line-level blocker in this branch.

@vincentkoc

Copy link
Copy Markdown
Member

The canonical fix for #97985 has now landed in #98010 as 4391041. I’m closing this PR as superseded so we keep one implementation path for the bundle-plugin update payload fix and avoid overlapping update-smoke behavior changes. Thanks for the work here; #98010 preserves the useful bundle-recognition behavior while also keeping native package payload validation for dual-format installs.

@vincentkoc vincentkoc closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

3 participants