@@ -89,6 +89,7 @@ import { suppressDeprecations } from "./suppress-deprecations.js";
8989
9090const 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: {
455456 devTargetRef ?: string ;
456457} ) : Promise < UpdateRunResult > {
457458 const updateRoot = params . switchToGit ? resolveGitInstallDir ( ) : params . root ;
458- const effectiveTimeout = params . timeoutMs ?? 20 * 60_000 ;
459+ const effectiveTimeout = params . timeoutMs ?? DEFAULT_UPDATE_STEP_TIMEOUT_MS ;
459460 const installEnv = await createGlobalInstallEnv ( ) ;
460461
461462 const cloneStep = params . switchToGit
@@ -537,6 +538,7 @@ async function updatePluginsAfterCoreUpdate(params: {
537538 channel : "stable" | "beta" | "dev" ;
538539 configSnapshot : Awaited < ReturnType < typeof readConfigFileSnapshot > > ;
539540 opts : UpdateCommandOptions ;
541+ timeoutMs : number ;
540542} ) : Promise < PostCorePluginUpdateResult > {
541543 if ( ! params . configSnapshot . valid ) {
542544 if ( ! params . opts . json ) {
@@ -589,6 +591,7 @@ async function updatePluginsAfterCoreUpdate(params: {
589591
590592 const npmResult = await updateNpmInstalledPlugins ( {
591593 config : pluginConfig ,
594+ timeoutMs : params . timeoutMs ,
592595 skipIds : new Set ( syncResult . summary . switchedToNpm ) ,
593596 logger : pluginLogger ,
594597 onIntegrityDrift : async ( drift ) => {
@@ -896,12 +899,14 @@ async function runPostCorePluginUpdate(params: {
896899 channel : "stable" | "beta" | "dev" ;
897900 configSnapshot : Awaited < ReturnType < typeof readConfigFileSnapshot > > ;
898901 opts : UpdateCommandOptions ;
902+ timeoutMs : number ;
899903} ) : Promise < PostCorePluginUpdateResult > {
900904 return await updatePluginsAfterCoreUpdate ( {
901905 root : params . root ,
902906 channel : params . channel ,
903907 configSnapshot : params . configSnapshot ,
904908 opts : params . opts ,
909+ timeoutMs : params . timeoutMs ,
905910 } ) ;
906911}
907912
@@ -954,6 +959,9 @@ async function continuePostCoreUpdateInFreshProcess(params: {
954959 if ( params . opts . yes ) {
955960 argv . push ( "--yes" ) ;
956961 }
962+ if ( params . opts . timeout ) {
963+ argv . push ( "--timeout" , params . opts . timeout ) ;
964+ }
957965 const resultDir =
958966 params . 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> {
10181026 if ( timeoutMs === null ) {
10191027 return ;
10201028 }
1029+ const updateStepTimeoutMs = timeoutMs ?? DEFAULT_UPDATE_STEP_TIMEOUT_MS ;
10211030
10221031 const root = await resolveUpdateRoot ( ) ;
10231032 if ( postCoreUpdateResume ) {
@@ -1036,6 +1045,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
10361045 channel : postCoreUpdateChannel ,
10371046 configSnapshot : await readConfigFileSnapshot ( ) ,
10381047 opts,
1048+ timeoutMs : updateStepTimeoutMs ,
10391049 } ) ;
10401050 if ( opts . json ) {
10411051 await writePostCorePluginUpdateResultFile (
@@ -1146,7 +1156,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
11461156 mode = 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,
12771287 jsonMode : Boolean ( opts . json ) ,
@@ -1414,6 +1424,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
14141424 channel,
14151425 configSnapshot : postUpdateConfigSnapshot ,
14161426 opts,
1427+ timeoutMs : updateStepTimeoutMs ,
14171428 } ) ;
14181429 }
14191430
0 commit comments