Repository navigation
Description
Bug
openclaw plugins update and openclaw update repair fail with:
npm view produced incomplete package metadata
for every npm-source plugin, even when the plugin is at the latest version on npm. After openclaw update runs, all npm plugins get auto-disabled because their update check returns this error.
Reproduction
OpenClaw 2026.7.1. From the user's shell:
$ npm view @openclaw/deepseek-provider name version dist.integrity dist.shasum openclaw --json
[
{
"name": "@openclaw/deepseek-provider",
"version": "2026.7.1",
"dist.integrity": "sha512-...",
"dist.shasum": "...",
"openclaw": { "..." }
}
]
# ^-- always returns an array, even for a single spec
$ openclaw plugins update deepseek
Could not check deepseek before update; falling back to installer path: npm view produced incomplete package metadata
Failed to update deepseek: npm view produced incomplete package metadataRoot cause
dist/install-source-utils-Bwqp8YNg.js → normalizeNpmViewMetadata(value):
function normalizeNpmViewMetadata(value) {
if (!value || typeof value !== "object") return null;
const rec = value; // BUG: value is an array
const name = normalizeOptionalString(rec.name); // always undefined
const version = normalizeOptionalString(rec.version);
const dist = rec.dist && typeof rec.dist === "object" ? rec.dist : {};
return {
name, // undefined
version, // undefined
resolvedSpec,
integrity: normalizeOptionalString(rec["dist.integrity"]) ?? normalizeOptionalString(dist.integrity),
shasum: normalizeOptionalString(rec["dist.shasum"]) ?? normalizeOptionalString(dist.shasum),
...isRecord(rec.openclaw) ? { packageOpenClaw: rec.openclaw } : {}
}; // → { name: undefined, version: undefined, ... }
}npm view --json always returns an array [{...}] (per npm's documented JSON output). The current code reads name/version/dist directly off the array object, so every field is undefined. The subsequent check !metadata?.name || !metadata.version is always true → error: "npm view produced incomplete package metadata".
Suggested fix
function normalizeNpmViewMetadata(value) {
if (!value || typeof value !== "object") return null;
// npm view --json always returns an array, even for a single spec.
// Unwrap before inspecting fields.
let rec = value;
if (Array.isArray(value)) {
if (value.length === 0 || value[0] == null || typeof value[0] !== "object") return null;
rec = value[0];
}
const name = normalizeOptionalString(rec.name);
const version = normalizeOptionalString(rec.version);
// ... rest unchanged ...
}Confirmed working patch
I applied this patch locally on 2026.7.1 and openclaw plugins update deepseek firecrawl llama-cpp openclaw-weixin now succeeds with the message: deepseek is up to date (2026.7.1-beta.2).
Impact
- Every
openclaw plugins update - Every
openclaw update repair - Every
openclaw plugins install <npm-package> - Every
openclaw update(because it auto-runs update on installed plugins)
is broken on 2026.7.1 for any npm-source plugin. Affected plugins get auto-disabled, which then blocks openclaw plugins enable with blocked by allowlist if the plugin isn't in plugins.allow (related issue filed separately). The combination of these bugs breaks the entire upgrade path: gateway cannot be re-enabled without manually editing SQLite + allowlist.
Environment
- OpenClaw 2026.7.1 (2d2ddc4)
- Node v24.15.0
- npm 11.6.2
- Linux (WSL Ubuntu 24.04)
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 14, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 14, 2026, 8:06 AM ET / 12:06 UTC.
Summary
Keep open: the released plugin lifecycle has a concrete shared-boundary regression, and current main still lacks evidence that array-shaped
npm view --jsonresults are normalized. The two related upgrade reports describe separate failures and do not supersede this fix.Reproducibility: yes. for v2026.7.1: the report provides concrete npm and OpenClaw commands, observed output, and a successful local patch. Current-main execution was not independently run, but the failing path remains directly reproducible from source inspection.
Root-cause cluster
Relationship:
canonicalCanonical: #107222
Summary: This issue is canonical for npm metadata array normalization; the two cross-referenced upgrade failures are distinct regressions that compound the same user journey.
Members:
adjacent_distinct: After 'openclaw update', new gateway refuses to start due to schema_meta checkpoint mismatch with no escape hatch #107223 - It concerns startup migration checkpoint enforcement after update, not npm metadata parsing.adjacent_distinct: 'openclaw update' shrinks plugins.allow, blocking re-enable of previously installed plugins #107224 - It concerns persisted plugin allowlist changes, not npm metadata parsing.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
The regression has a narrow shared resolver boundary, concrete released reproduction, clear tests, and no product or security decision blocker.
Review details
Best possible solution:
Normalize both record and single-record array responses in the shared source resolver, reject malformed or ambiguous arrays, and add focused regression coverage for install and update callers without patching generated
distfiles.Do we have a high-confidence way to reproduce the issue?
Yes for v2026.7.1: the report provides concrete npm and OpenClaw commands, observed output, and a successful local patch. Current-main execution was not independently run, but the failing path remains directly reproducible from source inspection.
Is this the best way to solve the issue?
Yes, with one refinement: fix the shared source normalizer rather than generated
distoutput, preserving object responses while accepting only valid single-record arrays and adding regression tests.AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against af9333975262.
Label changes
Label changes:
P0: The latest released update and plugin setup paths can disable or prevent installation of npm-source plugins, leaving ordinary users without an in-product recovery path.impact:ux-release-blocker: Recovering affected plugins currently requires source patching or other technical intervention rather than a supported update, repair, or setup flow.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P0: The latest released update and plugin setup paths can disable or prevent installation of npm-source plugins, leaving ordinary users without an in-product recovery path.impact:ux-release-blocker: Recovering affected plugins currently requires source patching or other technical intervention rather than a supported update, repair, or setup flow.Evidence reviewed
Acceptance criteria:
What I checked:
npm view --jsonoutput throughnormalizeNpmViewMetadata; the reported array shape reaches a normalizer that expects record fields directly. (src/infra/install-source-utils.ts:182, af9333975262)src/plugins/update.ts:305, af9333975262)src/infra/install-source-utils.test.ts:171, af9333975262)src/infra/install-source-utils.ts:182, 0da04d78e4a4)CHANGELOG.md:9, 2d2ddc43d0dc)Likely related people:
src/infra/install-source-utils.ts,src/infra/install-source-utils.test.ts,src/plugins/update.ts)src/infra/install-source-utils.ts,src/plugins/update.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.LeonidasLux commentedon Jul 14, 2026
Verification complete: fix already landed
This issue describes the
normalizeNpmViewMetadatabug wherenpm view --jsonarray output (npm 12+) was not unwrapped, causing all plugin update/install operations to fail withnpm view produced incomplete package metadata.The fix was shipped in PR #102883 (commit
96f0983a85, merged Jul 11, 2026), which added singleton-array unwrapping innormalizeNpmViewMetadataatsrc/infra/install-source-utils.ts:64-67:Verification results (current
upstream/main){...}[{...}][]Test status: 19/19 tests pass on
upstream/main.Related: PR #106436 extends the fix with state-preservation policy and sibling
parseNpmPackageTargetMetadatanormalization.Suggest closing this issue as already fixed by #102883.
steipete commentedon Jul 16, 2026
Fixed after the stable release.
The affected
v2026.7.1source reads the npm JSON array as an object atsrc/infra/install-source-utils.ts:60-78.v2026.7.2-beta.1includes the singleton-array normalization from #102883 atsrc/infra/install-source-utils.ts:60-83, which covers the reported one-package response. Currentmainadditionally handles multi-version output safely via #108336, selecting the maximum satisfying version and retaining malformed/range-miss failures as closed errors; focused coverage lives insrc/infra/install-source-utils.test.ts.Closing as completed. Stable
v2026.7.1remains affected; the fix is available inv2026.7.2-beta.1and later. Thanks @foxrainhy for the precise reproduction and confirmed patch.