


























@@ -89,6 +89,7 @@ import { suppressDeprecations } from "./suppress-deprecations.js";
89899090const CLI_NAME = resolveCliName();
9191const SERVICE_REFRESH_TIMEOUT_MS = 60_000;
92+const DEFAULT_UPDATE_STEP_TIMEOUT_MS = 20 * 60_000;
9293const POST_CORE_UPDATE_ENV = "OPENCLAW_UPDATE_POST_CORE";
9394const POST_CORE_UPDATE_CHANNEL_ENV = "OPENCLAW_UPDATE_POST_CORE_CHANNEL";
9495const POST_CORE_UPDATE_RESULT_PATH_ENV = "OPENCLAW_UPDATE_POST_CORE_RESULT_PATH";
@@ -455,7 +456,7 @@ async function runGitUpdate(params: {
455456devTargetRef?: string;
456457}): Promise<UpdateRunResult> {
457458const updateRoot = params.switchToGit ? resolveGitInstallDir() : params.root;
458-const effectiveTimeout = params.timeoutMs ?? 20 * 60_000;
459+const effectiveTimeout = params.timeoutMs ?? DEFAULT_UPDATE_STEP_TIMEOUT_MS;
459460const installEnv = await createGlobalInstallEnv();
460461461462const cloneStep = params.switchToGit
@@ -537,6 +538,7 @@ async function updatePluginsAfterCoreUpdate(params: {
537538channel: "stable" | "beta" | "dev";
538539configSnapshot: Awaited<ReturnType<typeof readConfigFileSnapshot>>;
539540opts: UpdateCommandOptions;
541+timeoutMs: number;
540542}): Promise<PostCorePluginUpdateResult> {
541543if (!params.configSnapshot.valid) {
542544if (!params.opts.json) {
@@ -589,6 +591,7 @@ async function updatePluginsAfterCoreUpdate(params: {
589591590592const npmResult = await updateNpmInstalledPlugins({
591593config: pluginConfig,
594+timeoutMs: params.timeoutMs,
592595skipIds: new Set(syncResult.summary.switchedToNpm),
593596logger: pluginLogger,
594597onIntegrityDrift: async (drift) => {
@@ -896,12 +899,14 @@ async function runPostCorePluginUpdate(params: {
896899channel: "stable" | "beta" | "dev";
897900configSnapshot: Awaited<ReturnType<typeof readConfigFileSnapshot>>;
898901opts: UpdateCommandOptions;
902+timeoutMs: number;
899903}): Promise<PostCorePluginUpdateResult> {
900904return await updatePluginsAfterCoreUpdate({
901905root: params.root,
902906channel: params.channel,
903907configSnapshot: params.configSnapshot,
904908opts: params.opts,
909+timeoutMs: params.timeoutMs,
905910});
906911}
907912@@ -954,6 +959,9 @@ async function continuePostCoreUpdateInFreshProcess(params: {
954959if (params.opts.yes) {
955960argv.push("--yes");
956961}
962+if (params.opts.timeout) {
963+argv.push("--timeout", params.opts.timeout);
964+}
957965const resultDir =
958966params.opts.json === true
959967 ? await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-update-post-core-"))
@@ -1018,6 +1026,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
10181026if (timeoutMs === null) {
10191027return;
10201028}
1029+const updateStepTimeoutMs = timeoutMs ?? DEFAULT_UPDATE_STEP_TIMEOUT_MS;
1021103010221031const root = await resolveUpdateRoot();
10231032if (postCoreUpdateResume) {
@@ -1036,6 +1045,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
10361045channel: postCoreUpdateChannel,
10371046configSnapshot: await readConfigFileSnapshot(),
10381047 opts,
1048+timeoutMs: updateStepTimeoutMs,
10391049});
10401050if (opts.json) {
10411051await writePostCorePluginUpdateResultFile(
@@ -1146,7 +1156,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
11461156mode = await resolveGlobalManager({
11471157 root,
11481158 installKind,
1149-timeoutMs: timeoutMs ?? 20 * 60_000,
1159+timeoutMs: updateStepTimeoutMs,
11501160});
11511161}
11521162@@ -1271,7 +1281,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
12711281 root,
12721282 installKind,
12731283 tag,
1274-timeoutMs: timeoutMs ?? 20 * 60_000,
1284+timeoutMs: updateStepTimeoutMs,
12751285 startedAt,
12761286 progress,
12771287jsonMode: Boolean(opts.json),
@@ -1414,6 +1424,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
14141424 channel,
14151425configSnapshot: postUpdateConfigSnapshot,
14161426 opts,
1427+timeoutMs: updateStepTimeoutMs,
14171428});
14181429}
14191430此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。