mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 20:51:10 +00:00
fix: warn on same-base prerelease configs
This commit is contained in:
@@ -53,7 +53,11 @@ import {
|
||||
validateConfigObjectRawWithPlugins,
|
||||
validateConfigObjectWithPlugins,
|
||||
} from "./validation.js";
|
||||
import { compareOpenClawVersions, isSameOpenClawStableFamily } from "./version.js";
|
||||
import {
|
||||
compareOpenClawVersions,
|
||||
isSameOpenClawStableFamily,
|
||||
parseOpenClawVersion,
|
||||
} from "./version.js";
|
||||
|
||||
// Re-export for backwards compatibility
|
||||
export { CircularIncludeError, ConfigIncludeError } from "./includes.js";
|
||||
@@ -622,9 +626,24 @@ function warnIfConfigFromFuture(cfg: OpenClawConfig, logger: Pick<typeof console
|
||||
if (!touched) {
|
||||
return;
|
||||
}
|
||||
const currentVersion = parseOpenClawVersion(VERSION);
|
||||
const touchedVersion = parseOpenClawVersion(touched);
|
||||
if (!currentVersion || !touchedVersion) {
|
||||
return;
|
||||
}
|
||||
if (isSameOpenClawStableFamily(VERSION, touched)) {
|
||||
return;
|
||||
}
|
||||
const sameBaseRelease =
|
||||
currentVersion.major === touchedVersion.major &&
|
||||
currentVersion.minor === touchedVersion.minor &&
|
||||
currentVersion.patch === touchedVersion.patch;
|
||||
if (sameBaseRelease && touchedVersion.prerelease?.length) {
|
||||
logger.warn(
|
||||
`Config was last written by a newer OpenClaw (${touched}); current version is ${VERSION}.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
const cmp = compareOpenClawVersions(VERSION, touched);
|
||||
if (cmp === null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user