Skip to content

plugins update --dry-run reports npm plugin target versions as unknown #78622

Closed

Description

@davelutztx

Summary

openclaw plugins update --all --dry-run is a supported option, but for npm-installed plugins it can report the target version as unknown even when npm metadata resolution succeeded and the version is available on the result object.

This makes dry-run output look suspicious/incomplete and forces operators to manually resolve package specs with npm view before trusting an update.

Observed behavior

Environment:

  • OpenClaw: 2026.5.6 (c97b9f7)
  • Install: global npm package install
  • Plugins: npm-installed OpenClaw plugins under ~/.openclaw/npm/node_modules

Command:

openclaw plugins update --all --dry-run

Output excerpt from a real preflight before updating from 2026.5.5 to 2026.5.6:

Would update acpx: 2026.5.5 -> unknown.
Would update brave: 2026.5.5 -> unknown.
Would update discord: 2026.5.5 -> unknown.
Would update lobster: 2026.5.5 -> unknown.

Manual resolution of the tracked install specs showed the versions were known and were normal upgrades:

acpx: install record spec @openclaw/acpx resolves to 2026.5.6
brave: install record spec @openclaw/brave-plugin resolves to 2026.5.6
discord: install record spec @openclaw/discord@latest resolves to 2026.5.6
lobster: install record spec @openclaw/lobster resolves to 2026.5.6

After the update, the plugins did update/load correctly at 2026.5.6.

Expected behavior

Dry-run should report the resolved npm target version when metadata resolution succeeds:

Would update acpx: 2026.5.5 -> 2026.5.6.

Why this matters

--dry-run is documented by openclaw plugins update --help:

--dry-run  Show what would change without writing

For update guardrails, unknown is not actionable enough. A safe updater has to treat current -> unknown as suspicious because it could be a downgrade, missing metadata, stale install record, or resolver bug.

Suspected cause

In the installed 2026.5.6 dist tree, the npm dry-run installer returns metadata on npmResolution:

if (dryRun) return {
  ok: true,
  pluginId: expectedPluginId ?? parsedSpec.name,
  targetDir: installRoot,
  extensions: [],
  npmResolution,
  ...
};

But the plugin update dry-run formatter appears to use only probe.version:

const nextVersion = probe.version ?? "unknown";
...
message: `Would update ${pluginId}: ${currentLabel} -> ${nextVersion}.`

So npm dry-run results can have probe.npmResolution.version available while probe.version is undefined, producing unknown.

Relevant installed files/symbols:

  • dist/install-*.js / installPluginFromNpmSpec(...)
  • dist/update-*.js / dry-run branch in plugin update handling
  • dist/plugins-update-command-*.js

Suggested fix

When formatting npm plugin dry-run outcomes, use a fallback like:

const resolvedVersion = probe.version ?? probe.npmResolution?.version;
const nextVersion = resolvedVersion ?? "unknown";

And set nextVersion in the outcome object from the same resolved value.

Regression test idea:

  • Mock an npm plugin dry-run where installPluginFromNpmSpec({ dryRun: true }) returns { ok: true, npmResolution: { version: "2026.5.6" } } and no top-level version.
  • Assert openclaw plugins update --all --dry-run prints current -> 2026.5.6, not current -> unknown.

Activity

  1. Martin-Blau commented on May 6, 2026

    @Martin-Blau

    @amknight I would like to contribute here, could you assign this on me?

  2. clawsweeper commented on May 6, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

    Current main and the shipped v2026.5.19 release already use npm resolution metadata when formatting plugin update dry-run target versions, so the reported unknown target-version problem is fixed.

    I found the merged PR that appears to have closed this: #83566: fix: fall back from official ClawHub artifact blocks.

    So I’m closing this as already implemented rather than keeping a duplicate issue open.

    Review details

    Best possible solution:

    Keep the shipped updater fallback and close this report rather than reopening duplicate fix branches for behavior already present in releases.

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

    Yes for the historical bug: the installer dry-run returned npmResolution.version without top-level version, while the old formatter ignored that metadata. Current main no longer reproduces because the formatter now consumes npmResolution.version.

    Is this the best way to solve the issue?

    Yes. The shipped implementation fixes the narrow formatter/data-contract mismatch by centralizing npm result-version extraction and using it before falling back to unknown.

    Security review:

    Security review: No PR patch is under review, and the issue is not a security-sensitive report.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • Current formatter uses npmResolution fallback: Current main computes npmProbeVersion from resolveNpmResultVersion(probe), includes it in resolvedProbeVersion, and uses that value for nextVersion and the dry-run message. (src/plugins/update.ts:1768, f1b8827d20c8)
    • Current helper reads npmResolution.version: resolveNpmResultVersion returns result.npmResolution?.version, which is the metadata field named in the report. (src/plugins/update.ts:761, f1b8827d20c8)
    • Installer dry-run contract still returns npmResolution: The managed npm install dry-run path returns npmResolution with no top-level version, matching the historical bug shape that the formatter now handles. (src/plugins/install.ts:1181, f1b8827d20c8)
    • Regression coverage for npm dry-run metadata path: The plugin update tests include a dry-run case where a successful npm fallback result has npmResolution.version and no top-level version, and the outcome uses that version instead of unknown. (src/plugins/update.test.ts:3313, f1b8827d20c8)
    • Fix commit provenance: Commit 3132969 introduced resolveNpmResultVersion and inserted it into the dry-run resolvedProbeVersion chain. (src/plugins/update.ts:506, 3132969c6850)
    • Release provenance: GitHub release/tag checks show v2026.5.19 was published on 2026-05-20, its compare from v2026.5.18 includes commit 3132969, and v2026.5.19 source contains the fallback while v2026.5.18 did not. (src/plugins/update.ts:506, 3132969c6850)

    Likely related people:

    • steipete: Authored the merged fix PR that introduced the npm result-version helper and dry-run fallback, and has the heaviest recent history in the plugin update files. (role: recent area contributor; confidence: high; commits: 3132969c6850, 99fc0fbac1ef, 5696e24c3f; files: src/plugins/update.ts, src/plugins/update.test.ts)
    • huntharo: Authored the merged versioned plugin update work that touched the same update/version selection surface. (role: adjacent feature contributor; confidence: medium; commits: 401ffb59f538; files: src/plugins/update.ts, src/plugins/update.test.ts, src/cli/plugins-cli.ts)
    • vincentkoc: Recent plugin-system commits and release-history touches appear in the same plugin update and test files, making this a useful secondary routing candidate. (role: adjacent area contributor; confidence: medium; commits: 8c802aa68351, 7198a9f0ee, 3ce5a8366a; files: src/plugins/update.ts, src/plugins/update.test.ts)

    Codex review notes: model internal, reasoning high; reviewed against f1b8827d20c8; fix evidence: merged PR #83566, release v2026.5.19, commit 3132969c6850.

  3. added a commit that references this issue on May 10, 2026
    f746dc6
  4. barnacle-openclaw commented on May 31, 2026

    @barnacle-openclaw

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. added
    P2Normal backlog priority with limited blast radius.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    on Jun 14, 2026
  6. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions