fix(update): preserve post-core host version

(cherry picked from commit e8d8c5dd6f)
This commit is contained in:
Peter Steinberger
2026-05-20 12:56:18 +01:00
parent 3c3ef6067e
commit e57fa51412
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -824,6 +824,7 @@ describe("update-cli", () => {
expect(call?.[2]?.env?.NODE_DISABLE_COMPILE_CACHE).toBe("1");
expect(call?.[2]?.env?.OPENCLAW_UPDATE_POST_CORE).toBe("1");
expect(call?.[2]?.env?.OPENCLAW_UPDATE_POST_CORE_CHANNEL).toBe("dev");
expect(call?.[2]?.env?.OPENCLAW_COMPATIBILITY_HOST_VERSION).toBe("1.0.0");
expect(updateNpmInstalledPlugins).not.toHaveBeenCalled();
expect(runDaemonInstall).not.toHaveBeenCalled();
expect(runDaemonRestart).not.toHaveBeenCalled();
+4
View File
@@ -2678,6 +2678,7 @@ async function continuePostCoreUpdateInFreshProcess(params: {
const resultPath = path.join(resultDir, "plugins.json");
const installRecordsPath = path.join(resultDir, "plugin-install-records.json");
const sourceConfigPath = path.join(resultDir, "source-config.json");
const postCoreHostVersion = await readPackageVersion(params.root);
try {
await writePostCorePluginInstallRecordsFile(installRecordsPath, params.pluginInstallRecords);
@@ -2695,6 +2696,9 @@ async function continuePostCoreUpdateInFreshProcess(params: {
[POST_CORE_UPDATE_RESULT_PATH_ENV]: resultPath,
[POST_CORE_UPDATE_INSTALL_RECORDS_PATH_ENV]: installRecordsPath,
[POST_CORE_UPDATE_STARTED_AT_ENV]: String(params.updateStartedAtMs),
...(postCoreHostVersion === null
? {}
: { OPENCLAW_COMPATIBILITY_HOST_VERSION: postCoreHostVersion }),
...(params.preUpdateConfig
? { [POST_CORE_UPDATE_SOURCE_CONFIG_PATH_ENV]: sourceConfigPath }
: {}),