Skip to content

fix(update): recognize bundle plugin payloads in post-update smoke check - #98024

Closed
ly-wang19 wants to merge 9 commits into
openclaw:mainfrom
ly-wang19:fix/update-bundle-plugin-smoke-97985
Closed

ly-wang19 wants to merge 9 commits into
openclaw:mainfrom
ly-wang19:fix/update-bundle-plugin-smoke-97985

Conversation

@ly-wang19

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users running openclaw update --yes on installs that include format=bundle plugins (Claude/Codex/Cursor plugin layout — .claude-plugin/plugin.json + skills/, no top-level package.json) would see every bundle plugin false-fail the post-update payload smoke check with package.json is missing, exit 1, and leave the gateway unloaded/down until manual recovery.

The post-core smoke check was npm-format-specific: it asked every tracked install record for an install directory containing package.json, with no branch for bundle-format manifests. Valid bundle plugins that load fine at runtime were therefore reported as corrupt, and the failure aborted before the gateway restart path.

Closes #97985.

Why This Change Was Made

Make the post-update payload smoke check format-aware: when package.json is absent, look for a known bundle manifest (.claude-plugin/plugin.json, codex, or cursor) and validate that instead. Bundle manifests are loaded via the existing loadBundleManifest and rejected when missing or capability-less.

The npm/code-plugin fail-closed path is preserved: npm and clawhubFamily=code-plugin records skip the bundle branch, so a genuinely broken npm payload still fails with missing-package-json. Marketplace/clawhub/git records opt into the bundle branch only when durable bundle metadata (recorded format, bundleFormat, manifest marker on disk, or recorded clawhubFamily=bundle-plugin) is present, preventing ambient skill directories from masquerading as bundle plugins.

Plugin install metadata now persists format, bundleFormat, and clawhubFamily so the smoke check can distinguish recorded bundle installs from native npm installs without re-probing.

User Impact

Users running openclaw update --yes with first-party format=bundle plugins under ~/.openclaw/extensions/ no longer see false-positive package.json is missing failures; the update completes and the gateway restarts on the new core version without manual openclaw daemon start recovery.

Evidence

  • New regression tests in src/cli/update-cli/plugin-payload-validation.test.ts cover:
    • bundle payload accepted without package.json when a valid .claude-plugin/plugin.json exists,
    • marketplace bundle records accepted without on-disk manifest when durable metadata is recorded,
    • marketplace npm-native records with leftover skill dirs not reinterpreted as bundles,
    • bundle manifest with no capabilities rejected with invalid-bundle-manifest,
    • npm and clawhubFamily=code-plugin records still fail-closed on missing package.json.
  • node scripts/run-vitest.mjs run src/cli/update-cli/plugin-payload-validation.test.ts src/plugins/installed-plugin-index.test.ts passes.
  • Reproduction aligns with the source-level repro in the ClawSweeper review of openclaw update: post-update plugin sync false-fails on format=bundle plugins ("package.json is missing"), exits 1 and unloads the gateway #97985: an active tracked install record with format: "bundle", an existing install directory, and no package.json previously produced missing-package-json; with this change it validates the bundle manifest instead.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M labels Jun 30, 2026
@clawsweeper

clawsweeper Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 12:39 AM ET / 04:39 UTC.

Summary
The PR updates post-update plugin payload smoke validation to accept bundle manifests without package.json and persists bundle format metadata in plugin install records.

PR surface: Source +156, Tests +304. Total +460 across 9 files.

Reproducibility: yes. Source inspection shows collectMissingPluginInstallPayloads still reports missing-package-json for tracked install directories without package.json, and runPostCorePluginUpdate calls it before the patched smoke check.

Review metrics: 2 noteworthy metrics.

  • Update payload gates: 1 changed, 1 unchanged. The smoke check is updated for bundles, but the earlier missing-payload collector still uses package-json-only classification before repair.
  • Persisted install metadata: 2 fields added. format and bundleFormat now become durable install-record inputs, so upgrade behavior depends on old and new record-loading paths.

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

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #97985
Summary: The linked issue is the canonical released update failure; this PR and sibling open PRs are candidate fixes for the same package-json-specific bundle payload checks.

Members:

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

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦪 silver shellfish
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • Make collectMissingPluginInstallPayloads bundle-aware with the same native/package precedence as the smoke check.
  • [P1] Add an update-command regression showing valid bundle records do not enter missing-payload repair while npm records without package.json still fail.
  • [P1] Add redacted after-fix terminal or log proof from the real update path or direct production-function run.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body cites regression tests and source-level reproduction, but does not include after-fix terminal output from a real update path or production-function run; add redacted terminal/log proof and update the PR body to trigger re-review.

Risk before merge

  • [P1] Valid bundle plugins can still be reported as missing payloads by collectMissingPluginInstallPayloads before the patched smoke check runs, then routed through package repair with disableOnFailure: true.
  • [P1] The PR adds persisted install metadata fields, so upgrade behavior for old records needs coverage through the same record-loading path used by update.
  • [P1] Contributor proof is test-only; there is no after-fix terminal/log proof from a real update path or production-function smoke outside the test runner.

Maintainer options:

  1. Repair Both Update Payload Gates (recommended)
    Update the missing-payload collector and the smoke check to share bundle-aware classification, then prove valid bundle installs no longer enter package repair while broken npm installs still fail closed.
  2. Pause For A Canonical Fix
    If a sibling PR lands the same issue with both update gates and real behavior proof covered, close this PR as superseded after that merge.

Next step before merge

  • [P1] Needs author or maintainer changes plus real behavior proof; ClawSweeper repair should not be requested while contributor proof is mock-only.

Security
Cleared: No concrete security or supply-chain regression was found; the diff reads local bundle manifests through existing plugin code and does not change dependencies, CI, permissions, or secret handling.

Review findings

  • [P1] Update the missing-payload collector for bundles — src/cli/update-cli/plugin-payload-validation.ts:94-96
Review details

Best possible solution:

Use one bundle-aware payload classification path for both collectMissingPluginInstallPayloads and runPluginPayloadSmokeCheck, preserving native package precedence and covering explicit plus manifestless bundle records with update-command regression proof.

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

Yes. Source inspection shows collectMissingPluginInstallPayloads still reports missing-package-json for tracked install directories without package.json, and runPostCorePluginUpdate calls it before the patched smoke check.

Is this the best way to solve the issue?

No. This is the right general boundary, but the fix is one-sided; the best fix must make both update-time payload gates bundle-aware while preserving package validation for true npm/code-plugin payloads.

Full review comments:

  • [P1] Update the missing-payload collector for bundles — src/cli/update-cli/plugin-payload-validation.ts:94-96
    This only teaches the later smoke check about bundle payloads. runPostCorePluginUpdate calls collectMissingPluginInstallPayloads first, and that collector still reports any tracked install dir without package.json as missing before passing the ids into package repair with disableOnFailure: true. Valid bundle plugins can still get the false missing-payload warning and be disabled before this new smoke branch runs, so share the bundle-aware classification with the collector and add an update-command regression.
    Confidence: 0.92

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P1: The PR targets a released update workflow that can leave users with false plugin failures and gateway recovery problems, and the branch still misses an earlier update gate.
  • add merge-risk: 🚨 compatibility: The diff changes persisted plugin install metadata and update-time interpretation of bundle versus package payloads during upgrades.
  • add merge-risk: 🚨 availability: The changed and still-unfixed validation gates run before gateway restart/recovery after a package update.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body cites regression tests and source-level reproduction, but does not include after-fix terminal output from a real update path or production-function run; add redacted terminal/log proof and update the PR body to trigger re-review.

Label justifications:

  • P1: The PR targets a released update workflow that can leave users with false plugin failures and gateway recovery problems, and the branch still misses an earlier update gate.
  • merge-risk: 🚨 compatibility: The diff changes persisted plugin install metadata and update-time interpretation of bundle versus package payloads during upgrades.
  • merge-risk: 🚨 availability: The changed and still-unfixed validation gates run before gateway restart/recovery after a package update.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body cites regression tests and source-level reproduction, but does not include after-fix terminal output from a real update path or production-function run; add redacted terminal/log proof and update the PR body to trigger re-review.
Evidence reviewed

PR surface:

Source +156, Tests +304. Total +460 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 158 2 +156
Tests 3 304 0 +304
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 462 2 +460

What I checked:

  • PR smoke-check branch: PR head adds bundle-aware handling only inside runPluginPayloadSmokeCheck after package.json is absent. (src/cli/update-cli/plugin-payload-validation.ts:93, 5fa2a47f1931)
  • Unchanged missing-payload collector: Current main still reports missing-package-json for any tracked install directory that exists without a top-level package.json. (src/cli/update-cli/update-command.ts:577, 85ee71223f0d)
  • Collector runs before convergence smoke: runPostCorePluginUpdate calls collectMissingPluginInstallPayloads before runPostCorePluginConvergence, and then calls updateNpmInstalledPlugins with disableOnFailure: true for the reported ids. (src/cli/update-cli/update-command.ts:1955, 85ee71223f0d)
  • Repair can disable on failure: The plugin update repair path disables a plugin config entry when disableOnFailure is set and a repair failure is recorded. (src/plugins/update.ts:1403, 85ee71223f0d)
  • PR scope omits update-command collector: The PR file list does not include src/cli/update-cli/update-command.ts or its collector tests, so the first update-time payload gate remains unchanged. (5fa2a47f1931)
  • Related canonical issue: The linked issue reports both Plugin install payload missing after update: package.json is missing... and the later post-core smoke failure for valid bundle plugins on v2026.6.10.

Likely related people:

  • BKF-Gitty: GitHub path history shows commit 109493b introduced mandatory post-core plugin convergence and active payload validation in the updater path. (role: introduced behavior; confidence: medium; commits: 109493bcdd62; files: src/cli/update-cli/plugin-payload-validation.ts, src/cli/update-cli/post-core-plugin-convergence.ts)
  • ly-wang19: GitHub path history shows recent work on the missing plugin payload id set in update-command.ts, which is the still-unfixed sibling gate. (role: recent update-path contributor; confidence: medium; commits: a0e9ca1e9544; files: src/cli/update-cli/update-command.ts)
  • steipete: GitHub path history shows bundle manifest and SQLite plugin index work that define the bundle metadata and persisted record behavior this PR reuses. (role: bundle and plugin-index contributor; confidence: high; commits: 5443baa8527e, f91fab8b1818, 532e42213d03; files: src/plugins/bundle-manifest.ts, src/plugins/installed-plugin-index-record-reader.ts)
  • RomneyDa: Local blame on current-main updater validation and record-reader lines points to the merged PR test: link ClawHub packaged plugin QA evidence #97712 squash commit that carried these files in the shallow checkout. (role: recent carrier of current lines; confidence: medium; commits: beab0ecb02dd; files: src/cli/update-cli/plugin-payload-validation.ts, src/plugins/installed-plugin-index-record-reader.ts)
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 rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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. labels Jun 30, 2026
@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. This branch was still needs-proof, so #98010 is the safer canonical path.

@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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openclaw update: post-update plugin sync false-fails on format=bundle plugins ("package.json is missing"), exits 1 and unloads the gateway

2 participants