Skip to content

fix: handle wildcard (*) in plugin API version range checks#56466

Closed
claygeo wants to merge 1 commit intoopenclaw:mainfrom
claygeo:fix/wildcard-plugin-api-range
Closed

fix: handle wildcard (*) in plugin API version range checks#56466
claygeo wants to merge 1 commit intoopenclaw:mainfrom
claygeo:fix/wildcard-plugin-api-range

Conversation

@claygeo
Copy link
Copy Markdown

@claygeo claygeo commented Mar 28, 2026

Problem

Fixes #56446

openclaw plugins install rejects plugins that declare peerDependencies: { "openclaw": "*" } with:

Plugin "@byterover/byterover" requires plugin API *, but this OpenClaw runtime exposes 2026.3.24.

The wildcard * is a standard semver range meaning "any version," but the hand-rolled semver parser in satisfiesComparator() doesn't recognize it. The * token falls through to the regex comparator which tries to parse it as a semver string, fails, and returns false.

Fix

Added an early return in satisfiesComparator() for standard semver wildcard tokens (*, x, X) so they correctly match any version. This is consistent with the npm/node-semver specification where these tokens represent "any version."

Tests

Added 4 test cases to the existing satisfiesPluginApiRange test covering *, x, and X wildcards against both calver (2026.3.24) and standard semver (1.0.0) versions. All pass.

The hand-rolled semver range parser in satisfiesComparator() does not
recognize *, x, or X as wildcard tokens that match any version. This
causes plugins with peerDependencies: { "openclaw": "*" } to be rejected
during installation with:

  Plugin "..." requires plugin API *, but this OpenClaw runtime exposes 2026.3.24.

Add an early return in satisfiesComparator() for standard semver wildcard
tokens (*, x, X) so they correctly match any version.

Fixes openclaw#56446

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 28, 2026

Greptile Summary

This PR fixes a bug where plugins declaring peerDependencies: { "openclaw": "*" } were incorrectly rejected during installation. The hand-rolled semver parser in satisfiesComparator() didn't handle standard wildcard tokens (*, x, X), causing them to fall through to the regex comparator, fail to parse, and return false.

Changes:

  • src/infra/clawhub.ts: Adds a 4-line early-return in satisfiesComparator() for the three standard semver wildcard tokens, correctly returning true (any version matches).
  • src/infra/clawhub.test.ts: Adds 4 regression test cases covering * against both calver and standard semver versions, and x/X against a calver version.

The fix is correct and well-scoped. One minor note: the x and X test cases only exercise the calver format (2026.3.24) — adding a 1.0.0 variant for those (as was done for *) would give slightly more symmetrical coverage, but this is purely cosmetic since the implementation is trivially identical for all three tokens.

Confidence Score: 5/5

Safe to merge — minimal, targeted fix with regression tests and no side effects.

The change is a 4-line early return in a well-understood function, directly addresses the reported bug, and is covered by new tests. No existing tests are broken, no other code paths are affected.

No files require special attention.

Important Files Changed

Filename Overview
src/infra/clawhub.ts Adds a 4-line early-return for wildcard tokens (*,x,X) in satisfiesComparator() — correct and minimal fix.
src/infra/clawhub.test.ts Adds 4 regression tests covering wildcard ranges against both calver and standard semver versions.

Reviews (1): Last reviewed commit: "fix: handle wildcard (*) in plugin API v..." | Re-trigger Greptile

@steipete
Copy link
Copy Markdown
Contributor

Thanks @claygeo. This was fixed on main by 6fddf17, which keeps the same root cause/fix direction and adds broader wildcard and installer-path regression coverage.

I landed it directly because main had moved significantly since this PR. The final patch covers src/infra/clawhub.ts, src/infra/clawhub.test.ts, and src/plugins/clawhub.test.ts, and closes #56446.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: openclaw plugins install rejects plugin with peerDependencies: { "openclaw": "*" } — wildcard API version not matched

2 participants