fix(plugins): skip update when npm metadata is unavailable instead of producing spurious spec error#95581
Conversation
… producing spurious spec error When npm view fails (transient registry error, rate limit, etc.), the update flow logged a warning and fell through to spec validation, which rejected version ranges with "unsupported npm spec". This produced two confusing error messages for a single transient failure. Fix: when metadata is unavailable, record the error and skip the plugin update instead of falling through to the guaranteed-to-fail installer path. Closes openclaw#77616
|
Codex review: needs real behavior proof before merge. Reviewed June 21, 2026, 6:55 PM ET / 22:55 UTC. Summary PR surface: Source +11. Total +11 across 1 file. Reproducibility: Source-reproducible, but not live-reproduced here: current main has the metadata-failure warning/fallback path and an adjacent mocked test for npm view failure. The exact live transient registry failure and after-fix behavior still need redacted real proof. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Preserve centralized failure handling or implement bounded metadata retry/no-output handling, align diagnostics and regression tests with the chosen behavior, and require redacted real update-path proof before merge. Do we have a high-confidence way to reproduce the issue? Source-reproducible, but not live-reproduced here: current main has the metadata-failure warning/fallback path and an adjacent mocked test for npm view failure. The exact live transient registry failure and after-fix behavior still need redacted real proof. Is this the best way to solve the issue? No, not as written; early skip is a plausible mitigation, but the best fix must preserve centralized failure handling or implement bounded metadata retry behavior with matching tests and proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a39e548ede22. Label changesLabel justifications:
Evidence reviewedPR surface: Source +11. Total +11 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Closing after 7 days with no review activity. This PR fixed spurious npm spec error after transient metadata fetch failure. Will re-open if reviewer feedback becomes available. |
What Problem This Solves
Plugin update check emits a confusing chain of two errors when
npm viewfails transiently:
npm view produced incomplete package metadata"
dist-tag (ranges are not allowed)"
The second message is spurious — the spec validation rejects the version
range only because the metadata it depends on was never fetched. Users
see two errors for a single transient registry failure.
Why This Change Was Made
When npm metadata is unavailable (transient registry error, rate limit,
etc.), the update flow logged a warning and fell through to
installPluginFromNpmSpec, which callsvalidateRegistryNpmSpec. Thatvalidator rejects version ranges with "unsupported npm spec", producing
a confusing second error.
The fix records the error and skips the plugin update entirely when
metadata is unavailable, avoiding the guaranteed-to-fail installer path.
Changes
src/plugins/update.ts— whenfetchNpmMetadataForUpdatefails,record an error outcome and
continueto the next plugin instead offalling through to spec validation
Evidence
plugins/update.test.tsandinstall.npm-spec.test.tscover the surrounding update and spec-validation logic
Related
Closes #77616