From 104628ed9c2b4cdc0b13785d89900683664a2b27 Mon Sep 17 00:00:00 2001 From: kumarabhirup Date: Wed, 18 Mar 2026 13:50:56 -0700 Subject: [PATCH] fix(bootstrap): set agents.defaults.timeoutSeconds=86400 to prevent premature termination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenClaw's default agent timeout is 600s (10 min), which consistently kills long-running agent responses — especially multi-file code generation and complex multi-tool-call workflows. This triggers: - 'terminated' errors mid-stream (webchat shows terminated banner) - Retry storms: same runId retries ~60s apart, then new runIds also fail - Follow-up messages silently dropped (shouldSkipMessageByAbortCutoff) Set the default to 86400s (24 hours) during bootstrap so all DenchClaw installations get a sane timeout out of the box. Note: the runtime code supports timeoutSeconds=0 (no timeout) but the config schema validation rejects 0 (exclusiveMinimum: 0), so 86400 is the practical maximum. Also rename ensureSubagentDefaults -> ensureAgentDefaults since the function now configures both agent-level and subagent-level settings. Refs: - https://github.com/openclaw/openclaw/issues/30487 - https://github.com/openclaw/openclaw/issues/46049 - https://github.com/openclaw/openclaw/issues/30083 --- src/cli/bootstrap-external.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/cli/bootstrap-external.ts b/src/cli/bootstrap-external.ts index cd1ce18f0e8..a285c9ecc2a 100644 --- a/src/cli/bootstrap-external.ts +++ b/src/cli/bootstrap-external.ts @@ -717,8 +717,15 @@ function stagePreOnboardConfig( ); } -async function ensureSubagentDefaults(openclawCommand: string, profile: string): Promise { +async function ensureAgentDefaults(openclawCommand: string, profile: string): Promise { const settings: Array<[string, string]> = [ + // Set agent timeout to 24 hours to prevent long-running agent runs from + // being terminated prematurely. OpenClaw's default is 600s (10 min) which + // consistently kills complex multi-tool-call responses and triggers retry + // storms + silently dropped follow-up messages. + // See: https://github.com/openclaw/openclaw/issues/30487 + // https://github.com/openclaw/openclaw/issues/46049 + ["agents.defaults.timeoutSeconds", "86400"], ["agents.defaults.subagents.maxConcurrent", "8"], ["agents.defaults.subagents.maxSpawnDepth", "2"], ["agents.defaults.subagents.maxChildrenPerAgent", "10"], @@ -2418,8 +2425,8 @@ export async function bootstrapCommand( plugins: managedBundledPlugins, }); - postOnboardSpinner?.message("Configuring subagent defaults…"); - await ensureSubagentDefaults(openclawCommand, profile); + postOnboardSpinner?.message("Configuring agent defaults…"); + await ensureAgentDefaults(openclawCommand, profile); // ── Gateway daemon restart + readiness verification ── // Skipped entirely in daemonless mode — the user manages the gateway process