fix: handle wildcard (*) in plugin API version range checks#56466
fix: handle wildcard (*) in plugin API version range checks#56466claygeo wants to merge 1 commit intoopenclaw:mainfrom
Conversation
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 SummaryThis PR fixes a bug where plugins declaring Changes:
The fix is correct and well-scoped. One minor note: the Confidence Score: 5/5Safe 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.
|
| 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
|
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 |
Problem
Fixes #56446
openclaw plugins installrejects plugins that declarepeerDependencies: { "openclaw": "*" }with:The wildcard
*is a standard semver range meaning "any version," but the hand-rolled semver parser insatisfiesComparator()doesn't recognize it. The*token falls through to the regex comparator which tries to parse it as a semver string, fails, and returnsfalse.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
satisfiesPluginApiRangetest covering*,x, andXwildcards against both calver (2026.3.24) and standard semver (1.0.0) versions. All pass.