Skip to content

Commit b8f6e16

Browse files
committed
fix(update): order stable correction releases after base
1 parent feb9a5a commit b8f6e16

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Docs: https://docs.openclaw.ai
6666
- Plugins/commands: scope QQBot framework slash commands to the QQBot channel so `/bot-*` command handlers and native specs do not leak onto unrelated chat surfaces. Thanks @vincentkoc.
6767
- fix: harden backend message action gateway routing [AI]. (#76374) Thanks @pgondhi987.
6868
- Gate QQBot streaming command auth [AI]. (#76375) Thanks @pgondhi987.
69+
- CLI/update: treat OpenClaw stable correction versions like `2026.5.3-1` as newer than their base stable release, so package updates no longer ask for downgrade confirmation.
6970
- Plugins/install: suppress dangerous-pattern scanner warnings for trusted official OpenClaw npm installs, so installing `@openclaw/discord` no longer prints credential-harvesting warnings for the official package.
7071
- Plugins/release: make the published npm runtime verifier reject blank `openclaw.runtimeExtensions` entries instead of treating them as absent and passing via inferred outputs. Thanks @vincentkoc.
7172
- Plugins/security: ignore inline and block comments when matching source-rule context in plugin install scans, so comment-only `fetch`/`post` references near environment defaults do not block clean plugins. Thanks @vincentkoc.

src/infra/update-check.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ describe("compareSemverStrings", () => {
2929
expect(compareSemverStrings("1.0.0", "1.0.0.beta.1")).toBe(1);
3030
});
3131

32+
it("treats OpenClaw stable correction releases as newer than their base release", () => {
33+
expect(compareSemverStrings("2026.5.3", "2026.5.3-1")).toBe(-1);
34+
expect(compareSemverStrings("2026.5.3-1", "2026.5.3")).toBe(1);
35+
expect(compareSemverStrings("2026.5.3-2", "2026.5.3-1")).toBe(1);
36+
});
37+
3238
it("returns null for invalid inputs", () => {
3339
expect(compareSemverStrings("1.0", "1.0.0")).toBeNull();
3440
expect(compareSemverStrings("latest", "1.0.0")).toBeNull();

src/infra/update-check.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from "node:path";
33
import { runCommandWithTimeout } from "../process/exec.js";
44
import { fetchWithTimeout } from "../utils/fetch-timeout.js";
55
import { detectPackageManager as detectPackageManagerImpl } from "./detect-package-manager.js";
6+
import { compareOpenClawReleaseVersions } from "./npm-registry-spec.js";
67
import { compareComparableSemver, parseComparableSemver } from "./semver-compare.js";
78
import { channelToNpmTag, type UpdateChannel } from "./update-channels.js";
89

@@ -384,6 +385,12 @@ export async function resolveNpmChannelTag(params: {
384385
}
385386

386387
export function compareSemverStrings(a: string | null, b: string | null): number | null {
388+
if (a && b) {
389+
const openClawReleaseCmp = compareOpenClawReleaseVersions(a, b);
390+
if (openClawReleaseCmp != null) {
391+
return openClawReleaseCmp;
392+
}
393+
}
387394
return compareComparableSemver(
388395
parseComparableSemver(a, { normalizeLegacyDotBeta: true }),
389396
parseComparableSemver(b, { normalizeLegacyDotBeta: true }),

0 commit comments

Comments
 (0)