




















@@ -9,7 +9,10 @@ import {
99ensureCompletionCacheExists,
1010} from "../../commands/doctor-completion.js";
1111import { doctorCommand } from "../../commands/doctor.js";
12-import { UPDATE_DEFER_CONFIGURED_PLUGIN_INSTALL_REPAIR_ENV } from "../../commands/doctor/shared/update-phase.js";
12+import {
13+UPDATE_DEFER_CONFIGURED_PLUGIN_INSTALL_REPAIR_ENV,
14+UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE_ENV,
15+} from "../../commands/doctor/shared/update-phase.js";
1316import { createPreUpdateConfigSnapshot } from "../../config/backup-rotation.js";
1417import {
1518assertConfigWriteAllowedInCurrentMode,
@@ -144,8 +147,6 @@ const POST_CORE_UPDATE_SOURCE_CONFIG_PATH_ENV = "OPENCLAW_UPDATE_POST_CORE_SOURC
144147const POST_CORE_UPDATE_STARTED_AT_ENV = "OPENCLAW_UPDATE_POST_CORE_STARTED_AT_MS";
145148const POST_CORE_UPDATE_RESULT_POLL_MS = 100;
146149const PRE_UPDATE_CONFIG_SNAPSHOT_MAX_AGE_MS = 6 * 60 * 60 * 1000;
147-const UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE_ENV =
148-"OPENCLAW_UPDATE_PARENT_SUPPORTS_DOCTOR_CONFIG_WRITE";
149150const SERVICE_REFRESH_PATH_ENV_KEYS = [
150151"OPENCLAW_HOME",
151152"OPENCLAW_STATE_DIR",
@@ -2733,6 +2734,14 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
27332734postCoreConfigSnapshot,
27342735preUpdateSourceConfig,
27352736);
2737+const parentPluginInstallRecords =
2738+await readPostCorePluginInstallRecordsFile(postCoreInstallRecordsPath);
2739+// The updated doctor may have repaired plugin installs before this fresh process resumed.
2740+const currentPluginInstallRecords = await loadInstalledPluginIndexInstallRecords();
2741+const pluginInstallRecords =
2742+Object.keys(currentPluginInstallRecords).length > 0
2743+ ? currentPluginInstallRecords
2744+ : parentPluginInstallRecords;
2736274527372746const pluginUpdate = await runPostCorePluginUpdate({
27382747 root,
@@ -2742,7 +2751,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
27422751restoredAuthoredChannels: restoredPostCoreConfig.authoredChannels,
27432752 opts,
27442753timeoutMs: updateStepTimeoutMs,
2745-pluginInstallRecords: await readPostCorePluginInstallRecordsFile(postCoreInstallRecordsPath),
2754+ pluginInstallRecords,
27462755});
27472756if (process.env[POST_CORE_UPDATE_RESULT_PATH_ENV]) {
27482757await writePostCorePluginUpdateResultFile(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。